Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: Remove unused function spi_busnum_to_master()

The last user is gone since commit

2962db71c703 ("staging/fbtft: Remove fbtft_device")

in 2019.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211007121415.2401638-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
bdc7ca00 6bfb15f3

-45
-8
Documentation/spi/spi-summary.rst
··· 336 336 Non-static Configurations 337 337 ^^^^^^^^^^^^^^^^^^^^^^^^^ 338 338 339 - Developer boards often play by different rules than product boards, and one 340 - example is the potential need to hotplug SPI devices and/or controllers. 341 - 342 - For those cases you might need to use spi_busnum_to_master() to look 343 - up the spi bus master, and will likely need spi_new_device() to provide the 344 - board info based on the board that was hotplugged. Of course, you'd later 345 - call at least spi_unregister_device() when that board is removed. 346 - 347 339 When Linux includes support for MMC/SD/SDIO/DataFlash cards through SPI, those 348 340 configurations will also be dynamic. Fortunately, such devices all support 349 341 basic device identification probes, so they should hotplug normally.
-35
drivers/spi/spi.c
··· 3033 3033 } 3034 3034 EXPORT_SYMBOL_GPL(spi_controller_resume); 3035 3035 3036 - static int __spi_controller_match(struct device *dev, const void *data) 3037 - { 3038 - struct spi_controller *ctlr; 3039 - const u16 *bus_num = data; 3040 - 3041 - ctlr = container_of(dev, struct spi_controller, dev); 3042 - return ctlr->bus_num == *bus_num; 3043 - } 3044 - 3045 - /** 3046 - * spi_busnum_to_master - look up master associated with bus_num 3047 - * @bus_num: the master's bus number 3048 - * Context: can sleep 3049 - * 3050 - * This call may be used with devices that are registered after 3051 - * arch init time. It returns a refcounted pointer to the relevant 3052 - * spi_controller (which the caller must release), or NULL if there is 3053 - * no such master registered. 3054 - * 3055 - * Return: the SPI master structure on success, else NULL. 3056 - */ 3057 - struct spi_controller *spi_busnum_to_master(u16 bus_num) 3058 - { 3059 - struct device *dev; 3060 - struct spi_controller *ctlr = NULL; 3061 - 3062 - dev = class_find_device(&spi_master_class, NULL, &bus_num, 3063 - __spi_controller_match); 3064 - if (dev) 3065 - ctlr = container_of(dev, struct spi_controller, dev); 3066 - /* reference got in class_find_device */ 3067 - return ctlr; 3068 - } 3069 - EXPORT_SYMBOL_GPL(spi_busnum_to_master); 3070 - 3071 3036 /*-------------------------------------------------------------------------*/ 3072 3037 3073 3038 /* Core methods for SPI resource management */
-2
include/linux/spi/spi.h
··· 760 760 struct spi_controller *ctlr); 761 761 extern void spi_unregister_controller(struct spi_controller *ctlr); 762 762 763 - extern struct spi_controller *spi_busnum_to_master(u16 busnum); 764 - 765 763 /* 766 764 * SPI resource management while processing a SPI message 767 765 */