[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeNSUniQtEmf9z1EGPun_3p1DZ_viXYXiAyDouU0s3uHg@mail.gmail.com>
Date: Wed, 8 May 2019 16:25:49 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Yurii Pavlovskyi <yurii.pavlovskyi@...il.com>
Cc: Corentin Chary <corentin.chary@...il.com>,
Darren Hart <dvhart@...radead.org>,
Andy Shevchenko <andy@...radead.org>,
Daniel Drake <drake@...lessm.com>,
acpi4asus-user <acpi4asus-user@...ts.sourceforge.net>,
Platform Driver <platform-driver-x86@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 01/11] platform/x86: asus-wmi: Fix hwmon device cleanup
On Fri, Apr 19, 2019 at 1:00 PM Yurii Pavlovskyi
<yurii.pavlovskyi@...il.com> wrote:
>
> The driver does not clean up the hwmon device on exit or error. To
> reproduce the bug, repeat rmmod, insmod to verify that device number
> /sys/devices/platform/asus-nb-wmi/hwmon/hwmon?? grows every time. Replace
> call for registering device with devm_* version that unregisters it
> automatically.
> struct device *hwmon;
>
> - hwmon = hwmon_device_register_with_groups(&asus->platform_device->dev,
> - "asus", asus,
> - hwmon_attribute_groups);
> + hwmon = devm_hwmon_device_register_with_groups(
> + &asus->platform_device->dev, "asus", asus,
> + hwmon_attribute_groups);
> +
Temporary variable would help with readability, i.e.
struct device *dev = &asus->platform_device->dev;
...
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists