[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABgtM3jpj4AdS5nydni0a4X98hXUzVLdWrPQva_B2E=kCBEnxA@mail.gmail.com>
Date: Tue, 4 Jul 2023 16:44:25 -0300
From: Joaquin Aramendia <samsagax@...il.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] hwmon: (oxp-sensors): remove static board variable
Hello.
>
> On 7/4/23 06:17, Greg Kroah-Hartman wrote:
> > Drivers should not have a single static variable for the type of device
> > they are bound to. While this driver is really going to only have one
> > device at a time in the system, remove the static variable and instead,
> > look up the device type when needed.
> >
>
> This is expensive. I think it would be much better to just move
> the board type detection into the init code and not instantiate
> the driver in the fist place if the board type is unknown.
I meant to do this, since the probe function is called only once and
is meant for hotpluggable things. But since it works as it is and only
loads in supported hardware it didn't seem necessary.
Modify what you see fit. And thanks for the attention to the quality
of the driver.
JoaquĆn
Powered by blists - more mailing lists