Commit e462f1f5 authored by Lad, Prabhakar's avatar Lad, Prabhakar Committed by Sekhar Nori

ARM: davinci: fix number of resources passed to davinci_gpio_register()

The davinci_gpio_register() function expects the number of
resources as the second parameter, but sizeof() resources
was passed to it due to which it was causing unexpected
behaviour. This patch fixes the same by passing the
ARRAY_SIZE() of resources.
Reported-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 34af1ab4
...@@ -906,7 +906,7 @@ static struct davinci_gpio_platform_data dm355_gpio_platform_data = { ...@@ -906,7 +906,7 @@ static struct davinci_gpio_platform_data dm355_gpio_platform_data = {
int __init dm355_gpio_register(void) int __init dm355_gpio_register(void)
{ {
return davinci_gpio_register(dm355_gpio_resources, return davinci_gpio_register(dm355_gpio_resources,
sizeof(dm355_gpio_resources), ARRAY_SIZE(dm355_gpio_resources),
&dm355_gpio_platform_data); &dm355_gpio_platform_data);
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
......
...@@ -720,7 +720,7 @@ static struct davinci_gpio_platform_data dm365_gpio_platform_data = { ...@@ -720,7 +720,7 @@ static struct davinci_gpio_platform_data dm365_gpio_platform_data = {
int __init dm365_gpio_register(void) int __init dm365_gpio_register(void)
{ {
return davinci_gpio_register(dm365_gpio_resources, return davinci_gpio_register(dm365_gpio_resources,
sizeof(dm365_gpio_resources), ARRAY_SIZE(dm365_gpio_resources),
&dm365_gpio_platform_data); &dm365_gpio_platform_data);
} }
......
...@@ -792,7 +792,7 @@ static struct davinci_gpio_platform_data dm644_gpio_platform_data = { ...@@ -792,7 +792,7 @@ static struct davinci_gpio_platform_data dm644_gpio_platform_data = {
int __init dm644x_gpio_register(void) int __init dm644x_gpio_register(void)
{ {
return davinci_gpio_register(dm644_gpio_resources, return davinci_gpio_register(dm644_gpio_resources,
sizeof(dm644_gpio_resources), ARRAY_SIZE(dm644_gpio_resources),
&dm644_gpio_platform_data); &dm644_gpio_platform_data);
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
......
...@@ -769,7 +769,7 @@ static struct davinci_gpio_platform_data dm646x_gpio_platform_data = { ...@@ -769,7 +769,7 @@ static struct davinci_gpio_platform_data dm646x_gpio_platform_data = {
int __init dm646x_gpio_register(void) int __init dm646x_gpio_register(void)
{ {
return davinci_gpio_register(dm646x_gpio_resources, return davinci_gpio_register(dm646x_gpio_resources,
sizeof(dm646x_gpio_resources), ARRAY_SIZE(dm646x_gpio_resources),
&dm646x_gpio_platform_data); &dm646x_gpio_platform_data);
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment