Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bcma: Use the proper gpio include

The <linux/bcma/bcma_driver_chipcommon.h> is including the legacy
header <linux/gpio.h> to obtain struct gpio_chip. Instead, include
<linux/gpio/driver.h> where this struct is defined.

It turns out that the brcm80211 brcmsmac depends on this to
bring in the symbol gpio_is_valid().

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. The whole check can be dropped
because the bcma_gpio is initialized in the declarations:

struct gpio_chip *bcma_gpio = &cc_drv->gpio;

And this can never be NULL.

Cc: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221028092332.238728-1-linus.walleij@linaro.org

authored by

Linus Walleij and committed by
Kalle Valo
2b6c0e15 81d17f6f

+1 -4
-3
drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c
··· 63 63 int hwnum = -1; 64 64 enum gpio_lookup_flags lflags = GPIO_ACTIVE_HIGH; 65 65 66 - if (!bcma_gpio || !gpio_is_valid(bcma_gpio->base)) 67 - return -ENODEV; 68 - 69 66 /* find radio enabled LED */ 70 67 for (i = 0; i < BRCMS_LED_NO; i++) { 71 68 u8 led = *leds[i];
+1 -1
include/linux/bcma/bcma_driver_chipcommon.h
··· 4 4 5 5 #include <linux/platform_device.h> 6 6 #include <linux/platform_data/brcmnand.h> 7 - #include <linux/gpio.h> 7 + #include <linux/gpio/driver.h> 8 8 9 9 /** ChipCommon core registers. **/ 10 10 #define BCMA_CC_ID 0x0000