[RFC PATCH 42/57] drivers: regulator: Use class_find_device_by_of_node helper

From: Suzuki K Poulose
Date: Mon Jun 03 2019 - 11:55:54 EST


Use the generic helper to find a device matching the of_node.

Cc: Liam Girdwood <lgirdwood@xxxxxxxxx>
Cc: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
---
drivers/regulator/of_regulator.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 0ead116..1485f6e 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -442,16 +442,11 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
return NULL;
}

-static int of_node_match(struct device *dev, const void *data)
-{
- return dev->of_node == data;
-}
-
struct regulator_dev *of_find_regulator_by_node(struct device_node *np)
{
struct device *dev;

- dev = class_find_device(&regulator_class, NULL, np, of_node_match);
+ dev = class_find_device_by_of_node(&regulator_class, NULL, np);

return dev ? dev_to_rdev(dev) : NULL;
}
--
2.7.4