Switch to using the bus_find_device_by_fwnode helper

Cc: "David S. Miller" <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c 
b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
index 09c16d8..b801ab7 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
@@ -754,17 +754,11 @@ struct dsaf_misc_op *hns_misc_op_get(struct dsaf_device 
*dsaf_dev)
        return (void *)misc_op;
 }
 
-static int hns_dsaf_dev_match(struct device *dev, void *fwnode)
-{
-       return dev->fwnode == fwnode;
-}
-
 struct
 platform_device *hns_dsaf_find_platform_device(struct fwnode_handle *fwnode)
 {
        struct device *dev;
 
-       dev = bus_find_device(&platform_bus_type, NULL,
-                             fwnode, hns_dsaf_dev_match);
+       dev = bus_find_device_by_fwnode(&platform_bus_type, NULL, fwnode);
        return dev ? to_platform_device(dev) : NULL;
 }
-- 
2.7.4

Reply via email to