diff mbox

gpio: brcmstb: Return proper error if bank width is invalid

Message ID 1460283315.10702.5.camel@ingics.com
State New
Headers show

Commit Message

Axel Lin April 10, 2016, 10:15 a.m. UTC
Return proper error in brcmstb_gpio_probe if bank width is invalid.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/gpio/gpio-brcmstb.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gregory Fong April 12, 2016, 10:59 p.m. UTC | #1
On Sun, Apr 10, 2016 at 3:15 AM, Axel Lin <axel.lin@ingics.com> wrote:
> Return proper error in brcmstb_gpio_probe if bank width is invalid.

Thanks for catching that.

>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Acked-by: Gregory Fong <gregory.0xf0@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij April 15, 2016, 8:10 a.m. UTC | #2
On Sun, Apr 10, 2016 at 12:15 PM, Axel Lin <axel.lin@ingics.com> wrote:

> Return proper error in brcmstb_gpio_probe if bank width is invalid.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Patch applied with Gregory's ACK.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index 42d51c5..e648914 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -461,6 +461,7 @@  static int brcmstb_gpio_probe(struct platform_device *pdev)
 		bank->id = num_banks;
 		if (bank_width <= 0 || bank_width > MAX_GPIO_PER_BANK) {
 			dev_err(dev, "Invalid bank width %d\n", bank_width);
+			err = -EINVAL;
 			goto fail;
 		} else {
 			bank->width = bank_width;