Skip to content

Commit 9d7b132

Browse files
committed
platform/x86: pcengines-apuv2: Add missing terminating entries to gpio-lookup tables
The gpiod_lookup_table.table passed to gpiod_add_lookup_table() must be terminated with an empty entry, add this. Note we have likely been getting away with this not being present because the GPIO lookup code first matches on the dev_id, causing most lookups to skip checking the table and the lookups which do check the table will find a matching entry before reaching the end. With that said, terminating these tables properly still is obviously the correct thing to do. Fixes: f8eb023 ("x86: pcengines apuv2 gpio/leds/keys platform driver") Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 085fc31 commit 9d7b132

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/platform/x86/pcengines-apuv2.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ static struct gpiod_lookup_table gpios_led_table = {
9494
NULL, 1, GPIO_ACTIVE_LOW),
9595
GPIO_LOOKUP_IDX(AMD_FCH_GPIO_DRIVER_NAME, APU2_GPIO_LINE_LED3,
9696
NULL, 2, GPIO_ACTIVE_LOW),
97+
{} /* Terminating entry */
9798
}
9899
};
99100

@@ -123,6 +124,7 @@ static struct gpiod_lookup_table gpios_key_table = {
123124
.table = {
124125
GPIO_LOOKUP_IDX(AMD_FCH_GPIO_DRIVER_NAME, APU2_GPIO_LINE_MODESW,
125126
NULL, 0, GPIO_ACTIVE_LOW),
127+
{} /* Terminating entry */
126128
}
127129
};
128130

0 commit comments

Comments
 (0)