aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-03-15 19:46:12 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-03-15 19:56:46 -0400
commit4d2508a55990c9b0fc1afb2c2cc5636712fd30f7 (patch)
tree682d1b4a344337b4e74518b5f7385e4c8586ca4e /arch/arm/mach-pxa
parent245f0db0de926601353776085e6f6a4c974c5615 (diff)
ARM: pxa/raumfeld: use PROPERTY_ENTRY_INTEGER to define props
gcc-6.0 notices that the use of the property_entry in this file that was recently introduced cannot work right, as we initialize the wrong field: raumfeld.c:387:3: error: the address of 'raumfeld_rotary_encoder_steps' will always evaluate as 'true' [-Werror=address] DEV_PROP_U32, 1, &raumfeld_rotary_encoder_steps, }, ^~~~~~~~~~~~ raumfeld.c:389:3: error: the address of 'raumfeld_rotary_encoder_axis' will always evaluate as 'true' [-Werror=address] DEV_PROP_U32, 1, &raumfeld_rotary_encoder_axis, }, ^~~~~~~~~~~~ raumfeld.c:391:3: error: the address of 'raumfeld_rotary_encoder_relative_axis' will always evaluate as 'true' [-Werror=address] DEV_PROP_U32, 1, &raumfeld_rotary_encoder_relative_axis, }, ^~~~~~~~~~~~ The problem appears to stem from relying on an old definition of 'struct property', but it has changed several times since the code could have last been correct. This changes the code to use the PROPERTY_ENTRY_INTEGER() macro instead, which works fine for the current definition and is a safer way of doing the initialization. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: a9e340dce3c3 ("Input: rotary_encoder - move away from platform data structure") Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/raumfeld.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index 16ffd01daff1..5a941bd3dbed 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -378,18 +378,11 @@ static struct gpiod_lookup_table raumfeld_rotary_gpios_table = {
378 }, 378 },
379}; 379};
380 380
381static u32 raumfeld_rotary_encoder_steps = 24;
382static u32 raumfeld_rotary_encoder_axis = REL_X;
383static u32 raumfeld_rotary_encoder_relative_axis = 1;
384
385static struct property_entry raumfeld_rotary_properties[] = { 381static struct property_entry raumfeld_rotary_properties[] = {
386 { "rotary-encoder,steps-per-period", 382 PROPERTY_ENTRY_INTEGER("rotary-encoder,steps-per-period", u32, 24),
387 DEV_PROP_U32, 1, &raumfeld_rotary_encoder_steps, }, 383 PROPERTY_ENTRY_INTEGER("linux,axis", u32, REL_X),
388 { "linux,axis", 384 PROPERTY_ENTRY_INTEGER("rotary-encoder,relative_axis", u32, 1),
389 DEV_PROP_U32, 1, &raumfeld_rotary_encoder_axis, }, 385 { },
390 { "rotary-encoder,relative_axis",
391 DEV_PROP_U32, 1, &raumfeld_rotary_encoder_relative_axis, },
392 { NULL }
393}; 386};
394 387
395static struct property_set raumfeld_rotary_property_set = { 388static struct property_set raumfeld_rotary_property_set = {