From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yurii Pavlovskyi Subject: Re: [PATCH 01/11] platform/x86: asus-wmi: Fix hwmon device cleanup Date: Fri, 12 Apr 2019 19:49:50 +0200 Message-ID: <3e14cbf9-2cb0-1a5d-9c2f-aa9ca014c660@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Daniel Drake Cc: Corentin Chary , Darren Hart , Andy Shevchenko , acpi4asus-user , Platform Driver , Linux Kernel List-Id: platform-driver-x86.vger.kernel.org Hello Daniel, thank you for the tip. I did not know about this function. It does indeed seem to make this complete patch redundant looking at 6e5f62b9e3651e61 hwmon: (lm90) Use devm_hwmon_device_register_with_groups I will surely implement it this way in the next version. Best regards, Yurii On 11.04.19 10:21, Daniel Drake wrote: > On Thu, Apr 11, 2019 at 4:21 AM Yurii Pavlovskyi > wrote: >> >> The asus-wmi 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. Add >> pointer to the device in module state and call cleanup on error. > > I wonder if this can be fixed more cleanly by using > devm_hwmon_device_register_with_groups() ? > > Thanks > Daniel >