Re: [PATCH 02/11] leds: add binding to check support for LED hw control

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

 



> +	/*
> +	 * Check if the LED driver supports the requested mode provided by the
> +	 * defined supported trigger to setup the LED to hw control mode.
> +	 */
> +	int			(*hw_control_is_supported)(struct led_classdev *led_cdev,
> +							   unsigned long flags);

Hi Christian

This needs better documentation. What is the expected return value? My
initial implementation for the Marvell driver did not work. I returned
-EINVAL if it was not supported and some value >= 0 if it was
supported. And most times, it was > 0, not 0.

However, when i look at the trigger code:

	/* Check if the requested mode is supported */
	ret = led_cdev->hw_control_is_supported(led_cdev, hw_mode);
	if (ret)
		return ret;

	*can_use_hw_control = true;

Anything other than 0 means it is not supported.

	 Andrew



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux