UPSTREAM: stlinkv3_spi.c: Clean up properly on all init error paths

If register_spi_master() fails, going to init exit cleanup is not
needed because at that point shutdown function has already been
registered and it does the job.

BUG=b:185191942
BRANCH=none
TEST=builds

Original-Change-Id: I9fabf48068635593bc86006c9642d8569eee8447
Original-Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/54190
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Original-Reviewed-by: Miklós Márton <martonmiklosqdev@gmail.com>
(cherry picked from commit cee470ecefbfdf7a1d08cb9d5cf3824c0f76e5c5)

Change-Id: Id79436e78011c4dac9001e37b0cc15a65058fd27
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/2908274
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: Edward O'Callaghan <quasisec@chromium.org>
1 file changed
tree: f1616d920a2b0939b6ee0f3fe37315e27e1fc9d7
  1. Documentation/
  2. subprojects/
  3. tests/
  4. util/
  5. .gitattributes
  6. .gitignore
  7. 82802ab.c
  8. action_descriptor.c
  9. action_descriptor.h
  10. amd_imc.c
  11. archtest.c
  12. at45db.c
  13. atahpt.c
  14. atapromise.c
  15. atavia.c
  16. big_lock.c
  17. big_lock.h
  18. bitbang_spi.c
  19. board_enable.c
  20. buspirate_spi.c
  21. cbtable.c
  22. ch341a_spi.c
  23. chipdrivers.h
  24. chipset_enable.c
  25. cli_classic.c
  26. cli_common.c
  27. cli_output.c
  28. COPYING
  29. coreboot_tables.h
  30. cros_alias.c
  31. cros_ec.c
  32. cros_ec.h
  33. cros_ec_commands.h
  34. cros_ec_dev.c
  35. custom_baud.c
  36. custom_baud.h
  37. dediprog.c
  38. developerbox_spi.c
  39. digilent_spi.c
  40. dmi.c
  41. drkaiser.c
  42. dummyflasher.c
  43. edi.c
  44. edi.h
  45. en29lv640b.c
  46. endiantest.c
  47. ene.h
  48. ene_lpc.c
  49. file_lock.c
  50. flash.h
  51. flashchips.c
  52. flashchips.h
  53. flashrom.8.tmpl
  54. flashrom.c
  55. fmap.c
  56. fmap.h
  57. ft2232_spi.c
  58. gfxnvidia.c
  59. helpers.c
  60. hwaccess.c
  61. hwaccess.h
  62. hwaccess_x86_io.h
  63. i2c_helper.h
  64. i2c_helper_linux.c
  65. ich_descriptors.c
  66. ich_descriptors.h
  67. ichspi.c
  68. internal.c
  69. ipc_lock.h
  70. it8212.c
  71. it85spi.c
  72. it87spi.c
  73. jedec.c
  74. jlink_spi.c
  75. layout.c
  76. layout.h
  77. libflashrom.c
  78. libflashrom.h
  79. libflashrom.map
  80. linux_mtd.c
  81. linux_spi.c
  82. lspcon_i2c_spi.c
  83. Makefile
  84. mcp6x_spi.c
  85. mec1308.c
  86. meson.build
  87. meson_options.txt
  88. mstarddc_spi.c
  89. ni845x_spi.c
  90. nic3com.c
  91. nicintel.c
  92. nicintel_eeprom.c
  93. nicintel_spi.c
  94. nicnatsemi.c
  95. nicrealtek.c
  96. ogp_spi.c
  97. opaque.c
  98. os.h
  99. OWNERS
  100. pcidev.c
  101. physmap.c
  102. pickit2_spi.c
  103. platform.h
  104. pony_spi.c
  105. power.c
  106. power.h
  107. PRESUBMIT.cfg
  108. print.c
  109. print_wiki.c
  110. processor_enable.c
  111. programmer.c
  112. programmer.h
  113. raiden_debug_spi.c
  114. rayer_spi.c
  115. README
  116. README.chromiumos
  117. realtek_mst_i2c_spi.c
  118. s25f.c
  119. satamv.c
  120. satasii.c
  121. sb600spi.c
  122. serial.c
  123. serprog.c
  124. serprog.h
  125. sfdp.c
  126. spi.c
  127. spi.h
  128. spi25.c
  129. spi25_statusreg.c
  130. spi95.c
  131. sst28sf040.c
  132. sst49lfxxxc.c
  133. sst_fwhub.c
  134. stlinkv3_spi.c
  135. stm50.c
  136. udelay.c
  137. unittest_env.h
  138. usb_device.c
  139. usb_device.h
  140. usbblaster_spi.c
  141. usbdev.c
  142. w29ee011.c
  143. w39.c
  144. wbsio_spi.c
  145. writeprotect.c
  146. writeprotect.h