X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fgpio%2Fpca953x.c;h=7371cd4a87fdd7b7a64afbb39ed4fd80e402d6cc;hb=30e6d979fa9da56a5badcb981cdddd58638d3375;hp=be1374592151b415c428182340a463c3c48492e0;hpb=bd23b22badadcdc414a900828253961fc5ec6c39;p=u-boot 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;