[RFC,16/57] net: hns_roce: Use bus_find_device_by_fwnode helper
diff mbox series

Message ID 1559577023-558-17-git-send-email-suzuki.poulose@arm.com
State New
Headers show
Series
  • [RFC,01/57] drivers: s390/cio: Use driver_for_each_device
Related show

Commit Message

Suzuki K Poulose June 3, 2019, 3:49 p.m. UTC
Switch to using the bus_find_device_by_fwnode helper

Cc: Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Jason Gunthorpe June 3, 2019, 4:05 p.m. UTC | #1
On Mon, Jun 03, 2019 at 04:49:42PM +0100, Suzuki K Poulose wrote:
> Switch to using the bus_find_device_by_fwnode helper
> 
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)

Acked-by: Jason Gunthorpe <jgg@mellanox.com>

Jason

Patch
diff mbox series

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 4c5d0f1..0985078 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -4497,19 +4497,13 @@  static const struct acpi_device_id hns_roce_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, hns_roce_acpi_match);
 
-static int hns_roce_node_match(struct device *dev, void *fwnode)
-{
-	return dev->fwnode == fwnode;
-}
-
 static struct
 platform_device *hns_roce_find_pdev(struct fwnode_handle *fwnode)
 {
 	struct device *dev;
 
 	/* get the 'device' corresponding to the matching 'fwnode' */
-	dev = bus_find_device(&platform_bus_type, NULL,
-			      fwnode, hns_roce_node_match);
+	dev = bus_find_device_by_fwnode(&platform_bus_type, NULL, fwnode);
 	/* get the platform device */
 	return dev ? to_platform_device(dev) : NULL;
 }