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]
Message-ID: <074963ce-d28f-413a-f35c-d503589a4604@ti.com>
Date:   Thu, 3 Oct 2019 19:23:36 +0200
From:   Jean-Jacques Hiblot <jjhiblot@...com>
To:     Sebastian Reichel <sre@...nel.org>
CC:     <jacek.anaszewski@...il.com>, <pavel@....cz>, <robh+dt@...nel.org>,
        <mark.rutland@....com>, <lee.jones@...aro.org>,
        <daniel.thompson@...aro.org>, <linux-kernel@...r.kernel.org>,
        <dri-devel@...ts.freedesktop.org>, <tomi.valkeinen@...com>,
        <dmurphy@...com>, <linux-leds@...r.kernel.org>
Subject: Re: [PATCH v8 5/5] backlight: add led-backlight driver

Sebastian,

On 03/10/2019 13:47, Sebastian Reichel wrote:
> Hi,
>
> On Thu, Oct 03, 2019 at 10:28:12AM +0200, Jean-Jacques Hiblot wrote:
>> From: Tomi Valkeinen <tomi.valkeinen@...com>
>>
>> This patch adds a led-backlight driver (led_bl), which is similar to
>> pwm_bl except the driver uses a LED class driver to adjust the
>> brightness in the HW. Multiple LEDs can be used for a single backlight.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...com>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@...com>
>> Acked-by: Pavel Machek <pavel@....cz>
>> Reviewed-by: Daniel Thompson <daniel.thompson@...aro.org>
>> ---
> Reviewed-by: Sebastian Reichel <sebastian.reichel@...labora.com>
>
> (with some suggestions below)

[...]


> I suggest to restructure:
>
> 1. call led_sysfs_disable
>
> 2. use devm_add_action_or_reset() to register the
>     led_sysfs_enable loop
>
> 3. use devm_backlight_device_register() to register BL
>
> 4. drop the remove function
>
>> +
>> +	backlight_update_status(priv->bl_dev);
>> +
>> +	return 0;
>> +}
>> +
>> +static int led_bl_remove(struct platform_device *pdev)
>> +{
>> +	struct led_bl_data *priv = platform_get_drvdata(pdev);
>> +	struct backlight_device *bl = priv->bl_dev;
>> +	int i;
>> +
>> +	backlight_device_unregister(bl);
>> +
>> +	led_bl_power_off(priv);
>> +	for (i = 0; i < priv->nb_leds; i++)
>> +		led_sysfs_enable(priv->leds[i]);
>> +
>> +	return 0;
>> +}
>> +
>> +static const struct of_device_id led_bl_of_match[] = {
>> +	{ .compatible = "led-backlight" },
>> +	{ }
>> +};
>> +
>> +MODULE_DEVICE_TABLE(of, led_bl_of_match);
>> +
>> +static struct platform_driver led_bl_driver = {
>> +	.driver		= {
>> +		.name		= "led-backlight",
>> +		.of_match_table	= of_match_ptr(led_bl_of_match),
> You should drop of_match_ptr(). Since the driver depends on OF,
> it will always simply return led_bl_of_match.
>
> (Also after removing the OF dependency from the driver it would
> either require led_bl_of_match to be marked __maybe_unused or
> moving it into a #if CONFIG_OF area to avoid warnings.)

Thanks for the suggestions. I think I'll work on them as a separate 
thing and post them after this is merged if there are no others changes 
required.

JJ

>
> -- Sebastian
>
>> +	},
>> +	.probe		= led_bl_probe,
>> +	.remove		= led_bl_remove,
>> +};
>> +
>> +module_platform_driver(led_bl_driver);
>> +
>> +MODULE_DESCRIPTION("LED based Backlight Driver");
>> +MODULE_LICENSE("GPL");
>> +MODULE_ALIAS("platform:led-backlight");
>> -- 
>> 2.17.1
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@...ts.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ