From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [PATCH 1/4] device connection: Remove device_connection_find()
Date: Fri, 4 Sep 2020 15:51:20 +0300 [thread overview]
Message-ID: <20200904125123.83725-2-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <20200904125123.83725-1-heikki.krogerus@linux.intel.com>
There are no users for that function.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/base/devcon.c | 73 ------------------------------------------
include/linux/device.h | 2 --
2 files changed, 75 deletions(-)
diff --git a/drivers/base/devcon.c b/drivers/base/devcon.c
index 14e2178e09f83..51ad546303ddb 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
diff --git a/include/linux/device.h b/include/linux/device.h
index 1c78621fc3c01..4a98cd2d442c7 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -319,8 +319,6 @@ void *fwnode_connection_find_match(struct fwnode_handle *fwnode,
void *device_connection_find_match(struct device *dev, const char *con_id,
void *data, devcon_match_fn_t match);
-struct device *device_connection_find(struct device *dev, const char *con_id);
-
void device_connection_add(struct device_connection *con);
void device_connection_remove(struct device_connection *con);
--
2.28.0
next prev parent reply other threads:[~2020-09-04 12:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 12:51 [PATCH 0/4] Remove struct device_connection Heikki Krogerus
2020-09-04 12:51 ` Heikki Krogerus [this message]
2020-09-04 12:51 ` [PATCH 2/4] device connection: Remove device_connection_add() Heikki Krogerus
2020-09-04 12:51 ` [PATCH 3/4] device connection: Remove struct device_connection Heikki Krogerus
2020-09-04 12:51 ` [PATCH 4/4] device property: Move fwnode_connection_find_match() under drivers/base/property.c Heikki Krogerus
2020-09-07 9:04 ` Greg Kroah-Hartman
2020-09-07 9:13 ` Heikki Krogerus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200904125123.83725-2-heikki.krogerus@linux.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox