Skip to content

Commit

Permalink
gpio: davinci: get rid of DAVINCI_N_GPIO
Browse files Browse the repository at this point in the history
Since Davinci GPIO driver is moved to support gpiolib it has to use
ARCH_NR_GPIOS (can be configured using CONFIG_ARCH_NR_GPIO Kconfig
option) configuration instead of any mach/platform specific options.

Hence, replace private DAVINCI_N_GPIO with common ARCH_NR_GPIOS. This is
safe because default value for ARCH_NR_GPIOS=256 and maximum number of
supported GPIOs for Davinci is DAVINCI_N_GPIO=144.

More over, this is one of steps to re-use Davinci GPIO driver by other
mach/platform.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
  • Loading branch information
Grygorii Strashko authored and Sekhar Nori committed Dec 25, 2013
1 parent 388291c commit c21d500
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ static int davinci_gpio_probe(struct platform_device *pdev)
return -EINVAL;
}

if (WARN_ON(DAVINCI_N_GPIO < ngpio))
ngpio = DAVINCI_N_GPIO;
if (WARN_ON(ARCH_NR_GPIOS < ngpio))
ngpio = ARCH_NR_GPIOS;

chips = devm_kzalloc(dev,
ngpio * sizeof(struct davinci_gpio_controller),
Expand Down

0 comments on commit c21d500

Please sign in to comment.