Re: [RFC/RFT PATCH v2] hwmon: (lm75) Hide register size differences in regmap access functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram,

On 12/18/24 08:07, Wolfram Sang wrote:
Hi Guenter,

quick response, will test your new patch later.

---
v2: Fix accesses to 16-bit configuration register.

Great, thanks, I missed that more fixing is needed.

     Use regmap access functions for all operations on config register.
     Declare regmap bus and use devm_regmap_init().

The regmap_bus solution is really nice! Didn't know about it.


Yes, it comes quite handy for hiding register access oddities (such as a mix
of 16-bit and 8-bit registers, or different read/write register addresses)
from the actual driver.

     Drop local configuration register copy; let regmap handle bit updates.

And one patch is gone from my queue. I had this as well :)

     Note: The driver could use additional cleanup, such as using bit macros
     and using devm_regulator_get_enable(). That is left for another day.

I didn't do BIT yet (although tempted), but I have the regulator cleanup
already. Also, 'client' can go from the priv struct with just a little
bit of reordering. I hope I can send all the stuff tomorrow.


Ah yes, 'client' can be passed as bus context, and isn't used elsewhere.
The access functions need lm75_data, but they can get the pointer to it
from drvdata.

Maybe that should be part of this patch. I assume you'll take it over - do you
want to make that change or should I send another version ? Handling it in a
separate patch is fine with me as well if you prefer to do that.

Thanks,
Guenter





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux