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

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.de


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6bfb15f3
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -336,14 +336,6 @@ certainly includes SPI devices hooked up through the card connectors!
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
configurations will also be dynamic.  Fortunately, such devices all support
basic device identification probes, so they should hotplug normally.
+0 −35
Original line number Diff line number Diff line
@@ -3033,41 +3033,6 @@ int spi_controller_resume(struct spi_controller *ctlr)
}
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 */
+0 −2
Original line number Diff line number Diff line
@@ -760,8 +760,6 @@ extern int devm_spi_register_controller(struct device *dev,
					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
 */