[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210329155046.125641ac@jic23-huawei>
Date: Mon, 29 Mar 2021 15:50:46 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Alexandru Ardelean <aardelean@...iqon.com>
Cc: platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org, coproscefalo@...il.com,
hdegoede@...hat.com, mgross@...ux.intel.com, linux@...iqon.com
Subject: Re: [PATCH 05/10] platform/x86: toshiba_acpi: register backlight
with device-managed variant
On Wed, 24 Mar 2021 14:55:43 +0200
Alexandru Ardelean <aardelean@...iqon.com> wrote:
> This change converts the registration of the backlight data with the
> devm_backlight_device_register() function.
> This way, the backlight_device_unregister() call is no longer required, and
> the order of deregistration is made to be more symmetrical with the
> registration order.
>
This one looks fine to me.
> Signed-off-by: Alexandru Ardelean <aardelean@...iqon.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> ---
> drivers/platform/x86/toshiba_acpi.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
> index 556f2cc99bad..ada2a2d8c913 100644
> --- a/drivers/platform/x86/toshiba_acpi.c
> +++ b/drivers/platform/x86/toshiba_acpi.c
> @@ -2876,7 +2876,8 @@ static int toshiba_acpi_setup_keyboard(struct device *parent,
> return error;
> }
>
> -static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev)
> +static int toshiba_acpi_setup_backlight(struct device *parent,
> + struct toshiba_acpi_dev *dev)
> {
> struct backlight_properties props;
> int brightness;
> @@ -2924,11 +2925,12 @@ static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev)
> if (dev->tr_backlight_supported)
> props.max_brightness++;
>
> - dev->backlight_dev = backlight_device_register("toshiba",
> - &dev->acpi_dev->dev,
> - dev,
> - &toshiba_backlight_data,
> - &props);
> + dev->backlight_dev = devm_backlight_device_register(parent,
> + "toshiba",
> + &dev->acpi_dev->dev,
> + dev,
> + &toshiba_backlight_data,
> + &props);
> if (IS_ERR(dev->backlight_dev)) {
> ret = PTR_ERR(dev->backlight_dev);
> pr_err("Could not register toshiba backlight device\n");
> @@ -2999,8 +3001,6 @@ static int toshiba_acpi_remove(struct acpi_device *acpi_dev)
> sysfs_remove_group(&dev->acpi_dev->dev.kobj,
> &toshiba_attr_group);
>
> - backlight_device_unregister(dev->backlight_dev);
> -
> led_classdev_unregister(&dev->led_dev);
> led_classdev_unregister(&dev->kbd_led);
> led_classdev_unregister(&dev->eco_led);
> @@ -3104,9 +3104,9 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev)
> ret = get_tr_backlight_status(dev, &dummy);
> dev->tr_backlight_supported = !ret;
>
> - ret = toshiba_acpi_setup_backlight(dev);
> + ret = toshiba_acpi_setup_backlight(parent, dev);
> if (ret)
> - goto error;
> + return ret;
>
> toshiba_illumination_available(dev);
> if (dev->illumination_supported) {
Powered by blists - more mailing lists