diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-06-22 18:22:48 +0800 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-08-16 13:45:15 -0400 |
commit | f21876174364391757e743cb8673d3fc5fce7ac7 (patch) | |
tree | a5bceb19aca4e5b4c8c9b54b743671f8424d99be /drivers/gpio/pca953x.c | |
parent | 2db1c3fc673c2ddfa1f8dbb41326d9763ea0ae64 (diff) | |
download | u-boot-f21876174364391757e743cb8673d3fc5fce7ac7.tar.gz u-boot-f21876174364391757e743cb8673d3fc5fce7ac7.tar.bz2 u-boot-f21876174364391757e743cb8673d3fc5fce7ac7.zip |
gpio: pca953x: Use ARRAY_SIZE instead of reinventing it
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/gpio/pca953x.c')
-rw-r--r-- | drivers/gpio/pca953x.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c index be13745921..7371cd4a87 100644 --- a/drivers/gpio/pca953x.c +++ b/drivers/gpio/pca953x.c @@ -47,9 +47,6 @@ struct pca953x_chip_ngpio { static struct pca953x_chip_ngpio pca953x_chip_ngpios[] = CONFIG_SYS_I2C_PCA953X_WIDTH; -#define NUM_CHIP_GPIOS (sizeof(pca953x_chip_ngpios) / \ - sizeof(struct pca953x_chip_ngpio)) - /* * Determine the number of GPIO pins supported. If we don't know we assume * 8 pins. @@ -58,7 +55,7 @@ static int pca953x_ngpio(uint8_t chip) { int i; - for (i = 0; i < NUM_CHIP_GPIOS; i++) + for (i = 0; i < ARRAY_SIZE(pca953x_chip_ngpios); i++) if (pca953x_chip_ngpios[i].chip == chip) return pca953x_chip_ngpios[i].ngpio; |