diff mbox series

brcm80211: brcmsmac: Drop BMCMA consistency check

Message ID 20221024124002.10120-1-linus.walleij@linaro.org
State New
Headers show
Series brcm80211: brcmsmac: Drop BMCMA consistency check | expand

Commit Message

Linus Walleij Oct. 24, 2022, 12:40 p.m. UTC
The driver looks up the BCMA parent GPIO driver and checks that
this succeeds, but then it goes on to use the deprecated GPIO
call gpio_is_valid() to check the consistency of the .base
member of the BCMA GPIO struct. Surely this belongs in the
BCMA driver: we cannot have all drivers performing cosistency
checks on the internals of things they are passed.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Oct. 26, 2022, 7:52 a.m. UTC | #1
On Tue, Oct 25, 2022 at 10:09 PM Kalle Valo <kvalo@kernel.org> wrote:

> Arend Van Spriel <arend.vanspriel@broadcom.com> writes:
>
> > On October 24, 2022 2:40:08 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> >
> >> The driver looks up the BCMA parent GPIO driver and checks that
> >> this succeeds, but then it goes on to use the deprecated GPIO
> >> call gpio_is_valid() to check the consistency of the .base
> >> member of the BCMA GPIO struct. Surely this belongs in the
> >> BCMA driver: we cannot have all drivers performing cosistency
> >
> > Should be: consistency
> >
> >>
> >> checks on the internals of things they are passed.
> >
> > Apart from the typo in the subject and missing wifi: prefix (replace
> > 'brcm80211' by 'wifi')...
>
> I can fix those.

I am sending a combined patch with this and the other bcma patch
because they happen to depend on each other. Dunno how to tag
a patch that affects bcma and brcn80211 at the same time so you
will probably have to edit it anyway.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c
index c1b9ac692d26..1cce92c5780f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c
@@ -63,7 +63,7 @@  int brcms_led_register(struct brcms_info *wl)
 	int hwnum = -1;
 	enum gpio_lookup_flags lflags = GPIO_ACTIVE_HIGH;
 
-	if (!bcma_gpio || !gpio_is_valid(bcma_gpio->base))
+	if (!bcma_gpio)
 		return -ENODEV;
 
 	/* find radio enabled LED */