Hi, sorry, this is more general
Michael
This patch take the min platform data array size and keys array size. Signed-off-by: Michael Trimarchi <[email protected]> diff --git a/drivers/input/keyboard/neo1973kbd.c b/drivers/input/keyboard/neo1973kbd.c index 56bc9ee..d78eea7 100644 --- a/drivers/input/keyboard/neo1973kbd.c +++ b/drivers/input/keyboard/neo1973kbd.c @@ -378,8 +378,7 @@ static int neo1973kbd_probe(struct platform_device *pdev) goto out_device_create_file; /* register GPIO IRQs */ - - for(n = 0; n < ARRAY_SIZE(keys); n++) { + for(n = 0; n < min(pdev->num_resources, ARRAY_SIZE(keys)); n++) { if (!pdev->resource[0].start) continue;
