Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1561122
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH net-next v4 06/10] net: dsa: Migrate to device_find_in_class_name() |
| Date | 2017-01-18 00:40 +0100 |
| Message-ID | <t0Lw6-4Y5-19@gated-at.bofh.it> (permalink) |
| References | <t0Lmp-4UR-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Now that the base device driver code provides an identical
implementation of dev_find_class() utilize device_find_in_class_name()
instead of our own version of it.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
net/dsa/dsa.c | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 2306d1b87c83..d9db63910887 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -455,29 +455,11 @@ EXPORT_SYMBOL_GPL(dsa_switch_resume);
#endif
/* platform driver init and cleanup *****************************************/
-static int dev_is_class(struct device *dev, void *class)
-{
- if (dev->class != NULL && !strcmp(dev->class->name, class))
- return 1;
-
- return 0;
-}
-
-static struct device *dev_find_class(struct device *parent, char *class)
-{
- if (dev_is_class(parent, class)) {
- get_device(parent);
- return parent;
- }
-
- return device_find_child(parent, class, dev_is_class);
-}
-
struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev)
{
struct device *d;
- d = dev_find_class(dev, "mdio_bus");
+ d = device_find_in_class_name(dev, "mdio_bus");
if (d != NULL) {
struct mii_bus *bus;
@@ -495,7 +477,7 @@ static struct net_device *dev_to_net_device(struct device *dev)
{
struct device *d;
- d = dev_find_class(dev, "net");
+ d = device_find_in_class_name(dev, "net");
if (d != NULL) {
struct net_device *nd;
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net-next v4 00/10] net: dsa: Support for pdata in dsa2 Florian Fainelli <f.fainelli@gmail.com> - 2017-01-18 00:30 +0100
[PATCH net-next v4 04/10] net: dsa: Move ports assignment closer to error checking Florian Fainelli <f.fainelli@gmail.com> - 2017-01-18 00:40 +0100
[PATCH net-next v4 07/10] net: Relocate dev_to_net_device() into net/core/dev.c Florian Fainelli <f.fainelli@gmail.com> - 2017-01-18 00:40 +0100
[PATCH net-next v4 06/10] net: dsa: Migrate to device_find_in_class_name() Florian Fainelli <f.fainelli@gmail.com> - 2017-01-18 00:40 +0100
[PATCH net-next v4 03/10] net: dsa: Suffix function manipulating device_node with _dn Florian Fainelli <f.fainelli@gmail.com> - 2017-01-18 00:40 +0100
[PATCH net-next v4 02/10] net: dsa: Make most functions take a dsa_port argument Florian Fainelli <f.fainelli@gmail.com> - 2017-01-18 00:40 +0100
Re: [PATCH net-next v4 00/10] net: dsa: Support for pdata in dsa2 David Miller <davem@davemloft.net> - 2017-01-18 23:00 +0100
Re: [PATCH net-next v4 00/10] net: dsa: Support for pdata in dsa2 Florian Fainelli <f.fainelli@gmail.com> - 2017-01-18 23:10 +0100
csiph-web