summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2015-10-14 09:37:28 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-10-17 01:32:17 +0300
commit648b15cb79e90d80f7b53d0184bdb14132a03754 (patch)
treed8cc9f8547eb49a87b7131a369a516a68654b689 /drivers/input
parent33b96d934902f96e901b72ac18bbc47afad1ac20 (diff)
downloadlinux-648b15cb79e90d80f7b53d0184bdb14132a03754.tar.xz
Input: rotary-encoder - use of_property_read_bool
This commit makes uses of_property_read_bool() to read boolean properties. This is just cosmetic cleanup. Signed-off-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/rotary_encoder.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index d1665544e109..962f9e86310b 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -175,14 +175,12 @@ static struct rotary_encoder_platform_data *rotary_encoder_parse_dt(struct devic
pdata->gpio_b = of_get_gpio_flags(np, 1, &flags);
pdata->inverted_b = flags & OF_GPIO_ACTIVE_LOW;
- pdata->relative_axis = !!of_get_property(np,
- "rotary-encoder,relative-axis", NULL);
- pdata->rollover = !!of_get_property(np,
- "rotary-encoder,rollover", NULL);
- pdata->half_period = !!of_get_property(np,
- "rotary-encoder,half-period", NULL);
- pdata->wakeup_source = !!of_get_property(np,
- "wakeup-source", NULL);
+ pdata->relative_axis =
+ of_property_read_bool(np, "rotary-encoder,relative-axis");
+ pdata->rollover = of_property_read_bool(np, "rotary-encoder,rollover");
+ pdata->half_period =
+ of_property_read_bool(np, "rotary-encoder,half-period");
+ pdata->wakeup_source = of_property_read_bool(np, "wakeup-source");
return pdata;
}