diff options
author | Marco Felsch <m.felsch@pengutronix.de> | 2022-06-16 16:07:36 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-06-17 09:27:29 +0200 |
commit | 18fdefae0569628a5490d2594afde6ceed39a088 (patch) | |
tree | 364230e1ce644a11a9bc2d02219c386f6fe0ef15 /drivers/regulator/fixed.c | |
parent | da65366c82635c424e9cc9cd02ce318e9bb07181 (diff) | |
download | barebox-18fdefae0569628a5490d2594afde6ceed39a088.tar.gz barebox-18fdefae0569628a5490d2594afde6ceed39a088.tar.xz |
regulator: fixed: use local device_node reference
Just a cosmetic commit, no functional changes. Use a local variable for
the device_node instead of dereference the pointer multiple times.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20220616140737.2294226-1-m.felsch@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r-- | drivers/regulator/fixed.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index f068fded62..9c660d5781 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -50,6 +50,7 @@ const static struct regulator_ops fixed_ops = { static int regulator_fixed_probe(struct device_d *dev) { + struct device_node *np = dev->device_node; struct regulator_fixed *fix; int ret; @@ -59,7 +60,7 @@ static int regulator_fixed_probe(struct device_d *dev) fix = xzalloc(sizeof(*fix)); fix->gpio = -EINVAL; - if (of_get_property(dev->device_node, "gpio", NULL)) { + if (of_get_property(np, "gpio", NULL)) { fix->gpio = gpiod_get(dev, NULL, GPIOD_ASIS); if (fix->gpio < 0) { ret = fix->gpio; @@ -71,13 +72,13 @@ static int regulator_fixed_probe(struct device_d *dev) fix->rdev.desc = &fix->rdesc; fix->rdev.dev = dev; - if (of_find_property(dev->device_node, "regulator-always-on", NULL) || - of_find_property(dev->device_node, "regulator-boot-on", NULL)) { + if (of_find_property(np, "regulator-always-on", NULL) || + of_find_property(np, "regulator-boot-on", NULL)) { fix->always_on = 1; regulator_fixed_enable(&fix->rdev); } - ret = of_regulator_register(&fix->rdev, dev->device_node); + ret = of_regulator_register(&fix->rdev, np); if (ret) return ret; |