Skip to content

Commit 4d2508a

Browse files
arndbdtor
authored andcommitted
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 <[email protected]> Fixes: a9e340d ("Input: rotary_encoder - move away from platform data structure") Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 245f0db commit 4d2508a

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

arch/arm/mach-pxa/raumfeld.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -378,18 +378,11 @@ static struct gpiod_lookup_table raumfeld_rotary_gpios_table = {
378378
},
379379
};
380380

381-
static u32 raumfeld_rotary_encoder_steps = 24;
382-
static u32 raumfeld_rotary_encoder_axis = REL_X;
383-
static u32 raumfeld_rotary_encoder_relative_axis = 1;
384-
385381
static struct property_entry raumfeld_rotary_properties[] = {
386-
{ "rotary-encoder,steps-per-period",
387-
DEV_PROP_U32, 1, &raumfeld_rotary_encoder_steps, },
388-
{ "linux,axis",
389-
DEV_PROP_U32, 1, &raumfeld_rotary_encoder_axis, },
390-
{ "rotary-encoder,relative_axis",
391-
DEV_PROP_U32, 1, &raumfeld_rotary_encoder_relative_axis, },
392-
{ NULL }
382+
PROPERTY_ENTRY_INTEGER("rotary-encoder,steps-per-period", u32, 24),
383+
PROPERTY_ENTRY_INTEGER("linux,axis", u32, REL_X),
384+
PROPERTY_ENTRY_INTEGER("rotary-encoder,relative_axis", u32, 1),
385+
{ },
393386
};
394387

395388
static struct property_set raumfeld_rotary_property_set = {

0 commit comments

Comments
 (0)