Commit 3997fb74 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Peter Rosin

i2c: mux: reg: use of_property_read_bool()

Use more compact of_property_read_bool() calls for the boolean properties
instead of of_find_property() calls in i2c_mux_reg_probe_dt().
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
parent 33d930e5
...@@ -107,9 +107,9 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux, ...@@ -107,9 +107,9 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux,
put_device(&adapter->dev); put_device(&adapter->dev);
mux->data.n_values = of_get_child_count(np); mux->data.n_values = of_get_child_count(np);
if (of_find_property(np, "little-endian", NULL)) { if (of_property_read_bool(np, "little-endian")) {
mux->data.little_endian = true; mux->data.little_endian = true;
} else if (of_find_property(np, "big-endian", NULL)) { } else if (of_property_read_bool(np, "big-endian")) {
mux->data.little_endian = false; mux->data.little_endian = false;
} else { } else {
#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : \ #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : \
...@@ -122,10 +122,7 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux, ...@@ -122,10 +122,7 @@ static int i2c_mux_reg_probe_dt(struct regmux *mux,
#error Endianness not defined? #error Endianness not defined?
#endif #endif
} }
if (of_find_property(np, "write-only", NULL)) mux->data.write_only = of_property_read_bool(np, "write-only");
mux->data.write_only = true;
else
mux->data.write_only = false;
values = devm_kzalloc(&pdev->dev, values = devm_kzalloc(&pdev->dev,
sizeof(*mux->data.values) * mux->data.n_values, sizeof(*mux->data.values) * mux->data.n_values,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment