Input: rotary-encoder - use of_property_read_bool
authorBen Gamari <bgamari.foss@gmail.com>
Wed, 14 Oct 2015 06:37:28 +0000 (23:37 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 16 Oct 2015 22:32:17 +0000 (15:32 -0700)
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>
drivers/input/misc/rotary_encoder.c

index d1665544e1091bd2cc26b8948f14ddee2d39698c..962f9e86310b6d0db6b0e61c3cfa3f4cf5ccf9af 100644 (file)
@@ -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;
 }