Skip to content

Commit 4127f69

Browse files
Sergei Shtylyovbroonie
authored andcommitted
regulator: fixed: use of_property_read_{bool|u32}()
Use more compact of_property_read_{bool|u32}() calls instead of the of_{find|get}_property() calls. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Mark Brown <broonie@linaro.org>
1 parent c9eaa44 commit 4127f69

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

‎drivers/regulator/fixed.c‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ of_get_fixed_voltage_config(struct device *dev)
5050
{
5151
struct fixed_voltage_config *config;
5252
struct device_node *np = dev->of_node;
53-
const __be32 *delay;
5453
struct regulator_init_data *init_data;
5554

5655
config = devm_kzalloc(dev, sizeof(struct fixed_voltage_config),
@@ -91,15 +90,11 @@ of_get_fixed_voltage_config(struct device *dev)
9190
if ((config->gpio == -ENODEV) || (config->gpio == -EPROBE_DEFER))
9291
return ERR_PTR(-EPROBE_DEFER);
9392

94-
delay = of_get_property(np, "startup-delay-us", NULL);
95-
if (delay)
96-
config->startup_delay = be32_to_cpu(*delay);
93+
of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
9794

98-
if (of_find_property(np, "enable-active-high", NULL))
99-
config->enable_high = true;
100-
101-
if (of_find_property(np, "gpio-open-drain", NULL))
102-
config->gpio_is_open_drain = true;
95+
config->enable_high = of_property_read_bool(np, "enable-active-high");
96+
config->gpio_is_open_drain = of_property_read_bool(np,
97+
"gpio-open-drain");
10398

10499
if (of_find_property(np, "vin-supply", NULL))
105100
config->input_supply = "vin";

0 commit comments

Comments
 (0)