diff mbox series

bcma: Fail probe if GPIO subdriver fails

Message ID 20221028093000.239020-1-linus.walleij@linaro.org
State New
Headers show
Series bcma: Fail probe if GPIO subdriver fails | expand

Commit Message

Linus Walleij Oct. 28, 2022, 9:30 a.m. UTC
We currently register the BCMA core even if the GPIO portions
fail. There is no reason for this: the GPIO should register
just fine, if it fails the BCMA driver should fail.

We already gracefully handle the case where the GPIO driver is
not compiled in.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/bcma/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Kalle Valo Nov. 4, 2022, 10:59 a.m. UTC | #1
Linus Walleij <linus.walleij@linaro.org> wrote:

> We currently register the BCMA core even if the GPIO portions
> fail. There is no reason for this: the GPIO should register
> just fine, if it fails the BCMA driver should fail.
> 
> We already gracefully handle the case where the GPIO driver is
> not compiled in.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Patch applied to wireless-next.git, thanks.

74a473007ce5 bcma: Fail probe if GPIO subdriver fails
diff mbox series

Patch

diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 44392b624b20..0a8469e0b13a 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -344,8 +344,10 @@  static int bcma_register_devices(struct bcma_bus *bus)
 	err = bcma_gpio_init(&bus->drv_cc);
 	if (err == -ENOTSUPP)
 		bcma_debug(bus, "GPIO driver not activated\n");
-	else if (err)
+	else if (err) {
 		bcma_err(bus, "Error registering GPIO driver: %i\n", err);
+		return err;
+	}
 
 	if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
 		err = bcma_chipco_watchdog_register(&bus->drv_cc);