diff options
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-ich.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-mcp23s08.c | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c index e73c6755a5eb..70304220a479 100644 --- a/drivers/gpio/gpio-ich.c +++ b/drivers/gpio/gpio-ich.c | |||
@@ -305,6 +305,8 @@ static struct ichx_desc ich6_desc = { | |||
305 | 305 | ||
306 | .ngpio = 50, | 306 | .ngpio = 50, |
307 | .have_blink = true, | 307 | .have_blink = true, |
308 | .regs = ichx_regs, | ||
309 | .reglen = ichx_reglen, | ||
308 | }; | 310 | }; |
309 | 311 | ||
310 | /* Intel 3100 */ | 312 | /* Intel 3100 */ |
@@ -324,6 +326,8 @@ static struct ichx_desc i3100_desc = { | |||
324 | .uses_gpe0 = true, | 326 | .uses_gpe0 = true, |
325 | 327 | ||
326 | .ngpio = 50, | 328 | .ngpio = 50, |
329 | .regs = ichx_regs, | ||
330 | .reglen = ichx_reglen, | ||
327 | }; | 331 | }; |
328 | 332 | ||
329 | /* ICH7 and ICH8-based */ | 333 | /* ICH7 and ICH8-based */ |
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c index 99a68310e7c0..3d53fd6880d1 100644 --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c | |||
@@ -894,9 +894,11 @@ static int mcp23s08_probe(struct spi_device *spi) | |||
894 | dev_err(&spi->dev, "invalid spi-present-mask\n"); | 894 | dev_err(&spi->dev, "invalid spi-present-mask\n"); |
895 | return -ENODEV; | 895 | return -ENODEV; |
896 | } | 896 | } |
897 | 897 | for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) { | |
898 | for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) | 898 | if ((spi_present_mask & (1 << addr))) |
899 | chips++; | ||
899 | pullups[addr] = 0; | 900 | pullups[addr] = 0; |
901 | } | ||
900 | } else { | 902 | } else { |
901 | type = spi_get_device_id(spi)->driver_data; | 903 | type = spi_get_device_id(spi)->driver_data; |
902 | pdata = dev_get_platdata(&spi->dev); | 904 | pdata = dev_get_platdata(&spi->dev); |
@@ -919,12 +921,12 @@ static int mcp23s08_probe(struct spi_device *spi) | |||
919 | pullups[addr] = pdata->chip[addr].pullups; | 921 | pullups[addr] = pdata->chip[addr].pullups; |
920 | } | 922 | } |
921 | 923 | ||
922 | if (!chips) | ||
923 | return -ENODEV; | ||
924 | |||
925 | base = pdata->base; | 924 | base = pdata->base; |
926 | } | 925 | } |
927 | 926 | ||
927 | if (!chips) | ||
928 | return -ENODEV; | ||
929 | |||
928 | data = kzalloc(sizeof(*data) + chips * sizeof(struct mcp23s08), | 930 | data = kzalloc(sizeof(*data) + chips * sizeof(struct mcp23s08), |
929 | GFP_KERNEL); | 931 | GFP_KERNEL); |
930 | if (!data) | 932 | if (!data) |