From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Hardware Monitoring <linux-hwmon@vger.kernel.org>
Subject: Re: [RFC/RFT PATCH] hwmon: (lm75) Hide register size differences in regmap access functions
Date: Wed, 18 Dec 2024 13:46:23 +0100 [thread overview]
Message-ID: <Z2LEH8mvVf4Uai19@ninjato> (raw)
In-Reply-To: <20241217225210.3298091-1-linux@roeck-us.net>
[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]
On Tue, Dec 17, 2024 at 02:52:10PM -0800, Guenter Roeck wrote:
> Hide register size differences in regmap access functions to simplify
> runtime code and to simplify adding support for I3C devices. Also
> use regmap API functions for bit operations where possible.
>
> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> This should help with adding I3C support.
> Module tested only.
Does that mean 'build tested as a module only'?
With the following small patch on top, it works \o/ I suggest that I
will include your patch in my series for adding I3C support. I have a
few patches on top already. I think this makes dependency handling a bit
easier?
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index f2550f623bee..1ef47ba6b458 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -653,6 +653,7 @@ static int lm75_probe(struct i2c_client *client)
if (!data)
return -ENOMEM;
+ /* Set this early. Our custom regmap callbacks need it */
dev_set_drvdata(dev, data);
data->client = client;
@@ -662,7 +663,7 @@ static int lm75_probe(struct i2c_client *client)
if (IS_ERR(data->vs))
return PTR_ERR(data->vs);
- data->regmap = devm_regmap_init_i2c(client, &lm75_regmap_config);
+ data->regmap = devm_regmap_init(&client->dev, NULL, data, &lm75_regmap_config);
if (IS_ERR(data->regmap))
return PTR_ERR(data->regmap);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-12-18 12:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 22:52 [RFC/RFT PATCH] hwmon: (lm75) Hide register size differences in regmap access functions Guenter Roeck
2024-12-18 12:46 ` Wolfram Sang [this message]
2024-12-18 14:46 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z2LEH8mvVf4Uai19@ninjato \
--to=wsa+renesas@sang-engineering.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.