From: Laszlo Papp <lpapp@kde.org>
To: jdelvare@suse.de
Cc: linux@roeck-us.net, lm-sensors@lm-sensors.org,
linux-kernel@vger.kernel.org, Laszlo Papp <lpapp@kde.org>
Subject: [PATCH] hwmon: (max6650) Dissociate the i2c device name from the hwmon device name
Date: Tue, 11 Feb 2014 10:24:07 +0000 [thread overview]
Message-ID: <1392114247-23921-1-git-send-email-lpapp@kde.org> (raw)
This is a necessary step to revamp the existing design of the driver for the
overall functionality the chip can provide. This will create a clean name-space
for each function.
Signed-off-by: Laszlo Papp <lpapp@kde.org>
---
drivers/hwmon/max6650.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
index 0cafc39..d4b1450 100644
--- a/drivers/hwmon/max6650.c
+++ b/drivers/hwmon/max6650.c
@@ -518,6 +518,7 @@ static struct attribute *max6650_attrs[] = {
&sensor_dev_attr_gpio2_alarm.dev_attr.attr,
NULL
};
+ATTRIBUTE_GROUPS(max6650);
static struct attribute_group max6650_attr_grp = {
.attrs = max6650_attrs,
@@ -543,6 +544,7 @@ static int max6650_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct max6650_data *data;
+ struct device *hwmon_dev;
int err;
data = devm_kzalloc(&client->dev, sizeof(struct max6650_data),
@@ -574,8 +576,12 @@ static int max6650_probe(struct i2c_client *client,
}
data->hwmon_dev = hwmon_device_register(&client->dev);
- if (!IS_ERR(data->hwmon_dev))
- return 0;
+ if (!IS_ERR(data->hwmon_dev)) {
+ hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev,
+ client->name, data,
+ max6650_groups);
+ return PTR_ERR_OR_ZERO(hwmon_dev);
+ }
err = PTR_ERR(data->hwmon_dev);
dev_err(&client->dev, "error registering hwmon device.\n");
--
1.8.5.4
reply other threads:[~2014-02-11 10:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1392114247-23921-1-git-send-email-lpapp@kde.org \
--to=lpapp@kde.org \
--cc=jdelvare@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lm-sensors@lm-sensors.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®