aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/fixed.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2014-05-25 15:50:39 -0400
committerMark Brown <broonie@linaro.org>2014-05-26 11:19:36 -0400
commit4127f696f9641afac8b8a05b9dd3dae48d384e08 (patch)
treecc89d3a5f95f1c0ec3afe0f3cad675c103b5682c /drivers/regulator/fixed.c
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff)
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>
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r--drivers/regulator/fixed.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index c61f7e97e4f8..354105eff1f8 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -50,7 +50,6 @@ of_get_fixed_voltage_config(struct device *dev)
50{ 50{
51 struct fixed_voltage_config *config; 51 struct fixed_voltage_config *config;
52 struct device_node *np = dev->of_node; 52 struct device_node *np = dev->of_node;
53 const __be32 *delay;
54 struct regulator_init_data *init_data; 53 struct regulator_init_data *init_data;
55 54
56 config = devm_kzalloc(dev, sizeof(struct fixed_voltage_config), 55 config = devm_kzalloc(dev, sizeof(struct fixed_voltage_config),
@@ -91,15 +90,11 @@ of_get_fixed_voltage_config(struct device *dev)
91 if ((config->gpio == -ENODEV) || (config->gpio == -EPROBE_DEFER)) 90 if ((config->gpio == -ENODEV) || (config->gpio == -EPROBE_DEFER))
92 return ERR_PTR(-EPROBE_DEFER); 91 return ERR_PTR(-EPROBE_DEFER);
93 92
94 delay = of_get_property(np, "startup-delay-us", NULL); 93 of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
95 if (delay)
96 config->startup_delay = be32_to_cpu(*delay);
97 94
98 if (of_find_property(np, "enable-active-high", NULL)) 95 config->enable_high = of_property_read_bool(np, "enable-active-high");
99 config->enable_high = true; 96 config->gpio_is_open_drain = of_property_read_bool(np,
100 97 "gpio-open-drain");
101 if (of_find_property(np, "gpio-open-drain", NULL))
102 config->gpio_is_open_drain = true;
103 98
104 if (of_find_property(np, "vin-supply", NULL)) 99 if (of_find_property(np, "vin-supply", NULL))
105 config->input_supply = "vin"; 100 config->input_supply = "vin";