diff mbox series

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

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

Commit Message

Suzuki K Poulose June 3, 2019, 3:50 p.m. UTC
Use the generic helper to find a device matching the of_node.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

---
 drivers/regulator/of_regulator.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

-- 
2.7.4

Comments

Mark Brown June 3, 2019, 4:04 p.m. UTC | #1
On Mon, Jun 03, 2019 at 04:50:08PM +0100, Suzuki K Poulose wrote:
> Use the generic helper to find a device matching the of_node.


Acked-by: Mark Brown <broonie@kernel.org>


Please use subject lines matching the style for the subsystem.  This
makes it easier for people to identify relevant patches.
diff mbox series

Patch

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;
 }