[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAO=notxzQUyRJ4L7w6o4Cdbwp-Sg4FXyMDgJUN-7YPm9JgiQuw@mail.gmail.com>
Date: Thu, 18 Apr 2019 13:35:31 -0700
From: Patrick Venture <venture@...gle.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: linux-hwmon@...r.kernel.org,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>,
linux-aspeed@...ts.ozlabs.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
OpenBMC Maillist <openbmc@...ts.ozlabs.org>,
linux-pm@...r.kernel.org, Jean Delvare <jdelvare@...e.com>,
Joel Stanley <joel@....id.au>,
Andrew Jeffery <andrew@...id.au>,
Avi Fishman <avifishman70@...il.com>,
Tomer Maimon <tmaimon77@...il.com>,
Tali Perry <tali.perry1@...il.com>,
Nancy Yuen <yuenn@...gle.com>,
Benjamin Fair <benjaminfair@...gle.com>,
Kamil Debski <kamil@...as.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Zhang Rui <rui.zhang@...el.com>,
Eduardo Valentin <edubezval@...il.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Mykola Kostenok <c_mykolak@...lanox.com>
Subject: Re: [PATCH 2/6] hwmon: (aspeed-pwm-tacho) Use devm_thermal_of_cooling_device_register
On Thu, Apr 18, 2019 at 12:58 PM Guenter Roeck <linux@...ck-us.net> wrote:
>
> Use devm_thermal_of_cooling_device_register() to register the cooling
> device. As a side effect, this fixes a driver bug:
> thermal_cooling_device_unregister() was not called on removal.
>
> Fixes: f198907d2ff6d ("hwmon: (aspeed-pwm-tacho) cooling device support.")
> Cc: Mykola Kostenok <c_mykolak@...lanox.com>
> Cc: Joel Stanley <joel@....id.au>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
Reviewed-by: Patrick Venture <venture@...gle.com>
> ---
> drivers/hwmon/aspeed-pwm-tacho.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
> index c4dd6301e7c8..0daf0b32aa4a 100644
> --- a/drivers/hwmon/aspeed-pwm-tacho.c
> +++ b/drivers/hwmon/aspeed-pwm-tacho.c
> @@ -830,10 +830,8 @@ static int aspeed_create_pwm_cooling(struct device *dev,
> }
> snprintf(cdev->name, MAX_CDEV_NAME_LEN, "%pOFn%d", child, pwm_port);
>
> - cdev->tcdev = thermal_of_cooling_device_register(child,
> - cdev->name,
> - cdev,
> - &aspeed_pwm_cool_ops);
> + cdev->tcdev = devm_thermal_of_cooling_device_register(dev, child,
> + cdev->name, cdev, &aspeed_pwm_cool_ops);
> if (IS_ERR(cdev->tcdev))
> return PTR_ERR(cdev->tcdev);
>
> --
> 2.7.4
>
Powered by blists - more mailing lists