spi: Remove code duplication in spi_add_device*()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 14 Jul 2023 09:17:45 +0000 (12:17 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 14 Jul 2023 13:44:36 +0000 (14:44 +0100)
commit36124dea164cf684869e856b2ada23e8adab5f03
tree729a754aefb8b840b150310bd4c0ac0da0e10e37
parent3b38cabd5e12b8b54b9c9feab9ab0093b991f249
spi: Remove code duplication in spi_add_device*()

The commit 0c79378c0199 ("spi: add ancillary device support")
added a dozen of duplicating lines of code. We may move them
to the __spi_add_device(). Note, that the code may be called
under the mutex.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20230714091748.89681-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c