Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sergei Shtylyov and committed by
Mark Brown
4127f696 c9eaa447

+4 -9
+4 -9
drivers/regulator/fixed.c
··· 50 50 { 51 51 struct fixed_voltage_config *config; 52 52 struct device_node *np = dev->of_node; 53 - const __be32 *delay; 54 53 struct regulator_init_data *init_data; 55 54 56 55 config = devm_kzalloc(dev, sizeof(struct fixed_voltage_config), ··· 90 91 if ((config->gpio == -ENODEV) || (config->gpio == -EPROBE_DEFER)) 91 92 return ERR_PTR(-EPROBE_DEFER); 92 93 93 - delay = of_get_property(np, "startup-delay-us", NULL); 94 - if (delay) 95 - config->startup_delay = be32_to_cpu(*delay); 94 + of_property_read_u32(np, "startup-delay-us", &config->startup_delay); 96 95 97 - if (of_find_property(np, "enable-active-high", NULL)) 98 - config->enable_high = true; 99 - 100 - if (of_find_property(np, "gpio-open-drain", NULL)) 101 - config->gpio_is_open_drain = true; 96 + config->enable_high = of_property_read_bool(np, "enable-active-high"); 97 + config->gpio_is_open_drain = of_property_read_bool(np, 98 + "gpio-open-drain"); 102 99 103 100 if (of_find_property(np, "vin-supply", NULL)) 104 101 config->input_supply = "vin";