[PATCH] v4 ath10k: add LED and GPIO controlling support for various chipsets

kbuild test robot lkp at intel.com
Sun Feb 18 21:53:28 PST 2018


Hi Sebastian,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v4.16-rc2]
[also build test ERROR on next-20180216]
[cannot apply to ath6kl/ath-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/s-gottschall-dd-wrt-com/v4-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets/20180219-113151
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/net/wireless/ath/ath10k/core.c:2209:41: sparse: not a function <noident>
   drivers/net/wireless/ath/ath10k/core.c:2209:24: sparse: bad constant expression type
   drivers/net/wireless/ath/ath10k/core.c:2212:20: sparse: no member 'dev' in struct gpio_chip
   drivers/net/wireless/ath/ath10k/core.c:2281:50: sparse: no member 'cdev' in struct ath10k_gpiocontrol
   drivers/net/wireless/ath/ath10k/core.c: In function 'ath10k_register_gpio_chip':
   drivers/net/wireless/ath/ath10k/core.c:2209:5: warning: "LINUX_VERSION_CODE" is not defined, evaluates to 0 [-Wundef]
    #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)
        ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/core.c:2209:27: warning: "KERNEL_VERSION" is not defined, evaluates to 0 [-Wundef]
    #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)
                              ^~~~~~~~~~~~~~
   drivers/net/wireless/ath/ath10k/core.c:2209:41: error: missing binary operator before token "("
    #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)
                                            ^
   drivers/net/wireless/ath/ath10k/core.c:2212:13: error: 'struct gpio_chip' has no member named 'dev'
     gpio->gchip.dev = ar->dev;
                ^
   drivers/net/wireless/ath/ath10k/core.c: In function 'ath10k_unregister_led':
>> drivers/net/wireless/ath/ath10k/core.c:2281:36: error: 'struct ath10k_gpiocontrol' has no member named 'cdev'
      led_classdev_unregister(&ar->gpio->cdev);
                                       ^~

vim +2281 drivers/net/wireless/ath/ath10k/core.c

  2197	
  2198	/* register GPIO chip */
  2199	static int ath10k_register_gpio_chip(struct ath10k *ar)
  2200	{
  2201		struct ath10k_gpiocontrol *gpio;
  2202		gpio = kzalloc(sizeof(struct ath10k_gpiocontrol), GFP_KERNEL);
  2203		if (!gpio) {
  2204			return -1;
  2205		}
  2206	 
  2207		snprintf(gpio->label, sizeof(gpio->label), "ath10k-%s",
  2208			 wiphy_name(ar->hw->wiphy));
> 2209	#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)
  2210		gpio->gchip.parent = ar->dev;
  2211	#else
  2212		gpio->gchip.dev = ar->dev;
  2213	#endif
  2214		gpio->gchip.base = -1;	/* determine base automatically */
  2215		gpio->gchip.ngpio = ar->hw_params.gpio_count;
  2216		gpio->gchip.label = gpio->label;
  2217		gpio->gchip.direction_input = ath10k_gpio_pin_cfg_input;
  2218		gpio->gchip.direction_output = ath10k_gpio_pin_cfg_output;
  2219		gpio->gchip.get_direction = ath10k_gpio_pin_get_dir;
  2220		gpio->gchip.get = ath10k_gpio_pin_get;
  2221		gpio->gchip.set = ath10k_gpio_pin_set;
  2222	
  2223		if (gpiochip_add(&gpio->gchip)) {
  2224			printk(KERN_ERR "Error while registering gpio chip\n");
  2225			return -1;
  2226		}
  2227		gpio->gchip.owner = NULL;
  2228		ar->gpio = gpio;
  2229		gpio->ar = ar;
  2230		return 0;
  2231	}
  2232	
  2233	#ifdef CONFIG_LEDS_CLASS
  2234	static void ath10k_led_brightness(struct led_classdev *led_cdev,
  2235				       enum led_brightness brightness)
  2236	{
  2237		struct ath10k_gpiocontrol *gpio = container_of(led_cdev, struct ath10k_gpiocontrol, cdev);
  2238		struct gpio_led *led = &gpio->wifi_led;
  2239		if (gpio->ar->state == ATH10K_STATE_ON) {
  2240			gpio->gpio_state_pin = (brightness != LED_OFF) ^ led->active_low;
  2241			ath10k_wmi_gpio_output(gpio->ar, led->gpio, gpio->gpio_state_pin);
  2242		}
  2243	}
  2244	
  2245	static int ath10k_add_led(struct ath10k *ar, struct gpio_led *gpioled)
  2246	{
  2247		int ret;
  2248		struct ath10k_gpiocontrol *gpio = ar->gpio; 
  2249		if (!gpio)
  2250			return -1;
  2251		gpio->cdev.name = gpioled->name;
  2252		gpio->cdev.default_trigger = gpioled->default_trigger;
  2253		gpio->cdev.brightness_set = ath10k_led_brightness;
  2254	
  2255		ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &gpio->cdev);
  2256		if (ret < 0)
  2257			return ret;
  2258	
  2259		return 0;
  2260	}
  2261	#endif
  2262	
  2263	#endif
  2264	
  2265	/* remove GPIO chip */
  2266	static void ath10k_unregister_gpio_chip(struct ath10k *ar)
  2267	{
  2268	#ifdef CONFIG_GPIOLIB
  2269		struct ath10k_gpiocontrol *gpio = ar->gpio; 
  2270		if (gpio) {
  2271			gpiochip_remove(&gpio->gchip);
  2272			kfree(gpio);
  2273		}
  2274	#endif
  2275	}
  2276	
  2277	static void ath10k_unregister_led(struct ath10k *ar)
  2278	{
  2279	#ifdef CONFIG_GPIOLIB
  2280		if (ar->gpio)
> 2281			led_classdev_unregister(&ar->gpio->cdev);
  2282	#endif
  2283	}
  2284	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 63116 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/ath10k/attachments/20180219/83023188/attachment-0001.gz>


More information about the ath10k mailing list