[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210926114934.GA7286@titan>
Date: Sun, 26 Sep 2021 13:49:34 +0200
From: Len Baker <len.baker@....com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Len Baker <len.baker@....com>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
Hans de Goede <hdegoede@...hat.com>,
Mark Gross <mgross@...ux.intel.com>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Kees Cook <keescook@...omium.org>,
ibm-acpi-devel@...ts.sourceforge.net,
platform-driver-x86@...r.kernel.org,
linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] platform/x86: thinkpad_acpi: Switch to common use of
attributes
Hi Greg,
On Sun, Sep 26, 2021 at 01:32:16PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Sep 26, 2021 at 01:19:08PM +0200, Len Baker wrote:
>
> > @@ -3161,9 +3106,7 @@ static void hotkey_exit(void)
> > hotkey_poll_stop_sync();
> > mutex_unlock(&hotkey_mutex);
> > #endif
> > -
> > - if (hotkey_dev_attributes)
> > - delete_attr_set(hotkey_dev_attributes, &tpacpi_pdev->dev.kobj);
> > + sysfs_remove_group(&tpacpi_pdev->dev.kobj, &hotkey_attr_group);
>
> Why do you have to manually add/remove these groups still?
>
> A huge hint that something is going wrong is when you have to call a
> sysfs_*() call from within a driver. There should be proper driver_*()
> calls for you instead to get the job done.
>
> As this is a platform device, why not set the dev_groups variable in the
> platform_driver field so that these attribute groups get added and
> removed automatically?
>
> An example commit to look at that shows how this was converted for one
> driver is 5bd08a4ae3d0 ("platform: x86: hp-wmi: convert platform driver
> to use dev_groups"). See if that helps here as well.
Ok, I will look at this and I will try to improve the patch. Anyway thanks
for the guidance and advices.
Again, thanks for your time.
Regards,
Len
Powered by blists - more mailing lists