Commit bdc7ca00 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Mark Brown

spi: Remove unused function spi_busnum_to_master()

The last user is gone since commit

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

in 2019.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211007121415.2401638-3-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6bfb15f3
...@@ -336,14 +336,6 @@ certainly includes SPI devices hooked up through the card connectors! ...@@ -336,14 +336,6 @@ certainly includes SPI devices hooked up through the card connectors!
Non-static Configurations Non-static Configurations
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
Developer boards often play by different rules than product boards, and one
example is the potential need to hotplug SPI devices and/or controllers.
For those cases you might need to use spi_busnum_to_master() to look
up the spi bus master, and will likely need spi_new_device() to provide the
board info based on the board that was hotplugged. Of course, you'd later
call at least spi_unregister_device() when that board is removed.
When Linux includes support for MMC/SD/SDIO/DataFlash cards through SPI, those When Linux includes support for MMC/SD/SDIO/DataFlash cards through SPI, those
configurations will also be dynamic. Fortunately, such devices all support configurations will also be dynamic. Fortunately, such devices all support
basic device identification probes, so they should hotplug normally. basic device identification probes, so they should hotplug normally.
......
...@@ -3033,41 +3033,6 @@ int spi_controller_resume(struct spi_controller *ctlr) ...@@ -3033,41 +3033,6 @@ int spi_controller_resume(struct spi_controller *ctlr)
} }
EXPORT_SYMBOL_GPL(spi_controller_resume); EXPORT_SYMBOL_GPL(spi_controller_resume);
static int __spi_controller_match(struct device *dev, const void *data)
{
struct spi_controller *ctlr;
const u16 *bus_num = data;
ctlr = container_of(dev, struct spi_controller, dev);
return ctlr->bus_num == *bus_num;
}
/**
* spi_busnum_to_master - look up master associated with bus_num
* @bus_num: the master's bus number
* Context: can sleep
*
* This call may be used with devices that are registered after
* arch init time. It returns a refcounted pointer to the relevant
* spi_controller (which the caller must release), or NULL if there is
* no such master registered.
*
* Return: the SPI master structure on success, else NULL.
*/
struct spi_controller *spi_busnum_to_master(u16 bus_num)
{
struct device *dev;
struct spi_controller *ctlr = NULL;
dev = class_find_device(&spi_master_class, NULL, &bus_num,
__spi_controller_match);
if (dev)
ctlr = container_of(dev, struct spi_controller, dev);
/* reference got in class_find_device */
return ctlr;
}
EXPORT_SYMBOL_GPL(spi_busnum_to_master);
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* Core methods for SPI resource management */ /* Core methods for SPI resource management */
......
...@@ -760,8 +760,6 @@ extern int devm_spi_register_controller(struct device *dev, ...@@ -760,8 +760,6 @@ extern int devm_spi_register_controller(struct device *dev,
struct spi_controller *ctlr); struct spi_controller *ctlr);
extern void spi_unregister_controller(struct spi_controller *ctlr); extern void spi_unregister_controller(struct spi_controller *ctlr);
extern struct spi_controller *spi_busnum_to_master(u16 busnum);
/* /*
* SPI resource management while processing a SPI message * SPI resource management while processing a SPI message
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment