diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2020-09-04 14:51:20 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-07 11:14:09 +0200 |
commit | 180c284ce4d66d2fb386b81bea59f01bc7be150a (patch) | |
tree | 26618b53adfc7d3bc45d7f40eee5f37a0aeafc47 /drivers/base/devcon.c | |
parent | scripts/dev-needs: Add script to list device dependencies (diff) | |
download | linux-180c284ce4d66d2fb386b81bea59f01bc7be150a.tar.xz linux-180c284ce4d66d2fb386b81bea59f01bc7be150a.zip |
device connection: Remove device_connection_find()
There are no users for that function.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20200904125123.83725-2-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/devcon.c')
-rw-r--r-- | drivers/base/devcon.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/drivers/base/devcon.c b/drivers/base/devcon.c index 14e2178e09f8..51ad546303dd 100644 --- a/drivers/base/devcon.c +++ b/drivers/base/devcon.c @@ -133,79 +133,6 @@ void *device_connection_find_match(struct device *dev, const char *con_id, } EXPORT_SYMBOL_GPL(device_connection_find_match); -extern struct bus_type platform_bus_type; -extern struct bus_type pci_bus_type; -extern struct bus_type i2c_bus_type; -extern struct bus_type spi_bus_type; - -static struct bus_type *generic_match_buses[] = { - &platform_bus_type, -#ifdef CONFIG_PCI - &pci_bus_type, -#endif -#ifdef CONFIG_I2C - &i2c_bus_type, -#endif -#ifdef CONFIG_SPI_MASTER - &spi_bus_type, -#endif - NULL, -}; - -static void *device_connection_fwnode_match(struct device_connection *con) -{ - struct bus_type *bus; - struct device *dev; - - for (bus = generic_match_buses[0]; bus; bus++) { - dev = bus_find_device_by_fwnode(bus, con->fwnode); - if (dev && !strncmp(dev_name(dev), con->id, strlen(con->id))) - return dev; - - put_device(dev); - } - return NULL; -} - -/* This tries to find the device from the most common bus types by name. */ -static void *generic_match(struct device_connection *con, int ep, void *data) -{ - struct bus_type *bus; - struct device *dev; - - if (con->fwnode) - return device_connection_fwnode_match(con); - - for (bus = generic_match_buses[0]; bus; bus++) { - dev = bus_find_device_by_name(bus, NULL, con->endpoint[ep]); - if (dev) - return dev; - } - - /* - * We only get called if a connection was found, tell the caller to - * wait for the other device to show up. - */ - return ERR_PTR(-EPROBE_DEFER); -} - -/** - * device_connection_find - Find two devices connected together - * @dev: Device with the connection - * @con_id: Identifier for the connection - * - * Find a connection with unique identifier @con_id between @dev and - * another device. On success returns handle to the device that is connected - * to @dev, with the reference count for the found device incremented. Returns - * NULL if no matching connection was found, or ERR_PTR(-EPROBE_DEFER) when a - * connection was found but the other device has not been enumerated yet. - */ -struct device *device_connection_find(struct device *dev, const char *con_id) -{ - return device_connection_find_match(dev, con_id, NULL, generic_match); -} -EXPORT_SYMBOL_GPL(device_connection_find); - /** * device_connection_add - Register a connection description * @con: The connection description to be registered |