Re: [PATCH 2/4] hid-lenovo: Add support for X1 Tablet cover LED control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dennis,

thanks a lot for the patch.

On Fri, 9 Dec 2016, Dennis Wassenberg wrote:

> +int hid_lenovo_led_set(enum hid_lenovo_led_type led, bool on)
> +{
> +	struct led_classdev *dev = NULL;
> +	struct lenovo_led_list_entry *entry;
> +
> +	if (led >= HID_LENOVO_LED_MAX)
> +		return -EINVAL;
> +
> +	hid_lenovo_initial_leds[led] = on ? LED_FULL : LED_OFF;
> +
> +	list_for_each_entry(entry, &hid_lenovo_leds, list) {
> +		if (entry->type == led) {
> +			dev = entry->dev;
> +			break;
> +		}
> +	}

How exactly is this synchronized against lenovo_remove_tpx1cover()?

> +
> +	if (!dev)
> +		return -ENODEV;
> +
> +	if (!dev->brightness_set)
> +		return -ENODEV;
> +
> +	dev->brightness_set(dev, on ? LED_FULL : LED_OFF);
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(hid_lenovo_led_set);

Does this really need to be exported to the whole universe? (I guess this 
will be further discussed in 4/4).

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux