lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 30 Apr 2023 20:08:35 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Christian Marangi <ansuelsmth@...il.com>
Cc:     Jonathan Corbet <corbet@....net>, Pavel Machek <pavel@....cz>,
        Lee Jones <lee@...nel.org>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-leds@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH 02/11] leds: add binding to check support for LED hw
 control

> +	/*
> +	 * 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ