diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2022-12-14 13:35:08 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-01-10 15:43:46 +0100 |
commit | e70b9d7a74698f1374244b2251216428db920aed (patch) | |
tree | b8091531241075d04501751b5236ab54afbe48c2 /drivers/regulator | |
parent | 12763d0fe56899d3729d0e6755446ed7c740a88a (diff) | |
download | barebox-e70b9d7a74698f1374244b2251216428db920aed.tar.gz |
Rename device_d::device_node to device_d::of_node
Linux struct device has the member of_node for the device_node pointer.
Rename this in barebox accordingly to minimize the necessary changes
when porting Linux code. This was done with the semantic patch:
@@ struct device_d E; @@
- E.device_node
+ E.of_node
@@ struct device_d *E; @@
- E->device_node
+ E->of_node
Plus some manual adjustments.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20221214123512.189688-2-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/anatop-regulator.c | 4 | ||||
-rw-r--r-- | drivers/regulator/core.c | 8 | ||||
-rw-r--r-- | drivers/regulator/fixed.c | 4 | ||||
-rw-r--r-- | drivers/regulator/pfuze.c | 2 | ||||
-rw-r--r-- | drivers/regulator/rk808-regulator.c | 2 | ||||
-rw-r--r-- | drivers/regulator/scmi-regulator.c | 2 | ||||
-rw-r--r-- | drivers/regulator/stm32-pwr.c | 2 | ||||
-rw-r--r-- | drivers/regulator/stm32-vrefbuf.c | 2 | ||||
-rw-r--r-- | drivers/regulator/stpmic1_regulator.c | 2 |
9 files changed, 14 insertions, 14 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index 3f8473ec07..6d54129523 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c @@ -35,7 +35,7 @@ static struct regulator_ops anatop_rops = { static int anatop_regulator_probe(struct device_d *dev) { - struct device_node *np = dev->device_node; + struct device_node *np = dev->of_node; struct device_node *anatop_np; struct regulator_desc *rdesc; struct regulator_dev *rdev; @@ -131,7 +131,7 @@ static int anatop_regulator_probe(struct device_d *dev) } } - return of_regulator_register(rdev, dev->device_node); + return of_regulator_register(rdev, dev->of_node); } static const struct of_device_id of_anatop_regulator_match_tbl[] = { diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index d25aba38c3..d25aea8d62 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -255,7 +255,7 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c /* * If the device does have a device node return the dummy regulator. */ - if (!dev->device_node) + if (!dev->of_node) return NULL; propname = basprintf("%s-supply", supply); @@ -264,7 +264,7 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c * If the device node does not contain a supply property, this device doesn't * need a regulator. Return the dummy regulator in this case. */ - if (!of_get_property(dev->device_node, propname, NULL)) { + if (!of_get_property(dev->of_node, propname, NULL)) { dev_dbg(dev, "No %s-supply node found, using dummy regulator\n", supply); ri = NULL; @@ -275,7 +275,7 @@ static struct regulator_internal *of_regulator_get(struct device_d *dev, const c * The device node specifies a supply, so it's mandatory. Return an error when * something goes wrong below. */ - node = of_parse_phandle(dev->device_node, propname, 0); + node = of_parse_phandle(dev->of_node, propname, 0); if (!node) { dev_dbg(dev, "No %s node found\n", propname); ri = ERR_PTR(-EINVAL); @@ -388,7 +388,7 @@ struct regulator *regulator_get(struct device_d *dev, const char *supply) struct regulator *r; int ret; - if (dev->device_node && supply) { + if (dev->of_node && supply) { ri = of_regulator_get(dev, supply); if (IS_ERR(ri)) return ERR_CAST(ri); diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index bdb01c0a95..65b0fba2fe 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -46,12 +46,12 @@ const static struct regulator_ops fixed_ops = { static int regulator_fixed_probe(struct device_d *dev) { - struct device_node *np = dev->device_node; + struct device_node *np = dev->of_node; struct regulator_fixed *fix; u32 delay; int ret; - if (!dev->device_node) + if (!dev->of_node) return -EINVAL; fix = xzalloc(sizeof(*fix)); diff --git a/drivers/regulator/pfuze.c b/drivers/regulator/pfuze.c index 5ef5dacc6f..d9450711e3 100644 --- a/drivers/regulator/pfuze.c +++ b/drivers/regulator/pfuze.c @@ -165,7 +165,7 @@ static int __init pfuze_probe(struct device_d *dev) if (pfuze_init_callback) pfuze_init_callback(pfuze_dev->map); - if (of_property_read_bool(dev->device_node, + if (of_property_read_bool(dev->of_node, "fsl,pmic-stby-poweroff")) return poweroff_handler_register_fn(pfuze_power_off_prepare); diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index f8bc31f354..e0e06acad4 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -889,7 +889,7 @@ static int rk808_regulator_dt_parse(struct device_d *dev, struct of_regulator_match *matches, int nregulators) { - struct device_node *np = dev->device_node; + struct device_node *np = dev->of_node; np = of_get_child_by_name(np, "regulators"); if (!np) diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c index 3e6fd3ec60..5bab296102 100644 --- a/drivers/regulator/scmi-regulator.c +++ b/drivers/regulator/scmi-regulator.c @@ -335,7 +335,7 @@ static int scmi_regulator_probe(struct scmi_device *sdev) * plausible SCMI Voltage Domain number, all belonging to this SCMI * platform instance node (handle->dev->of_node). */ - np = of_find_node_by_name(handle->dev->device_node, "regulators"); + np = of_find_node_by_name(handle->dev->of_node, "regulators"); for_each_child_of_node(np, child) { ret = process_scmi_regulator_of_node(sdev, ph, child, rinfo); /* abort on any mem issue */ diff --git a/drivers/regulator/stm32-pwr.c b/drivers/regulator/stm32-pwr.c index 8cb0b0c12e..ac738b4ee9 100644 --- a/drivers/regulator/stm32-pwr.c +++ b/drivers/regulator/stm32-pwr.c @@ -152,7 +152,7 @@ static int stm32_pwr_regulator_probe(struct device_d *dev) if (IS_ERR(iores)) return PTR_ERR(iores); - for_each_child_of_node(dev->device_node, child) { + for_each_child_of_node(dev->of_node, child) { const struct stm32_pwr_desc *desc = NULL; for (i = 0; i < STM32PWR_REG_NUM_REGS; i++) { diff --git a/drivers/regulator/stm32-vrefbuf.c b/drivers/regulator/stm32-vrefbuf.c index 77287c2b0e..80733fed3d 100644 --- a/drivers/regulator/stm32-vrefbuf.c +++ b/drivers/regulator/stm32-vrefbuf.c @@ -173,7 +173,7 @@ static int stm32_vrefbuf_probe(struct device_d *dev) rdev->dev = dev; rdev->desc = &stm32_vrefbuf_regu.desc; - ret = of_regulator_register(rdev, dev->device_node); + ret = of_regulator_register(rdev, dev->of_node); if (ret) { ret = PTR_ERR(rdev); dev_err(dev, "register failed with error %d\n", ret); diff --git a/drivers/regulator/stpmic1_regulator.c b/drivers/regulator/stpmic1_regulator.c index 63ed4468ed..ee4abb5b81 100644 --- a/drivers/regulator/stpmic1_regulator.c +++ b/drivers/regulator/stpmic1_regulator.c @@ -408,7 +408,7 @@ static int stpmic1_regulator_probe(struct device_d *dev) { int i, ret; - ret = of_regulator_match(dev, dev->device_node, stpmic1_matches, + ret = of_regulator_match(dev, dev->of_node, stpmic1_matches, ARRAY_SIZE(stpmic1_matches)); if (ret < 0) { dev_err(dev, "Error in PMIC regulator device tree node"); |