@@ -603,6 +603,18 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
struct brcmstb_gpio_bank *bank;
struct gpio_chip *gc;
+ /*
+ * If bank_width is 0, then there is an empty bank in the
+ * register block. Special handling for this case.
+ */
+ if (bank_width == 0) {
+ dev_dbg(dev, "Fake bank %d (GPIO(s): %d-%d)\n",
+ num_banks, gpio_base, gpio_base + MAX_GPIO_PER_BANK);
+ num_banks++;
+ gpio_base += MAX_GPIO_PER_BANK;
+ continue;
+ }
+
bank = devm_kzalloc(dev, sizeof(*bank), GFP_KERNEL);
if (!bank) {
err = -ENOMEM;
@@ -611,7 +623,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
bank->parent_priv = priv;
bank->id = num_banks;
- if (bank_width <= 0 || bank_width > MAX_GPIO_PER_BANK) {
+ if (bank_width < 0 || bank_width > MAX_GPIO_PER_BANK) {
dev_err(dev, "Invalid bank width %d\n", bank_width);
err = -EINVAL;
goto fail;