From: gregkh@suse.de (Greg KH)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] hwmon: Missing class check in two hwmon drivers
Date: Sat, 29 Oct 2005 00:15:42 +0000 [thread overview]
Message-ID: <11305336621727@kroah.com> (raw)
[PATCH] hwmon: Missing class check in two hwmon drivers
The atxp1 and ds1621 drivers should make sure they do not probe
non-hwmon i2c adapters.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
commit ddec748f328af6b67e4d0ce0248a8e9f36751827
tree ce99658260e0a5f3d56e67d5d33ce8e498947990
parent 7ab83a9137ccd3e092fb6ad0cb105b4d1fb617ae
author Jean Delvare <khali@linux-fr.org> Mon, 17 Oct 2005 23:02:42 +0200
committer Greg Kroah-Hartman <gregkh@suse.de> Fri, 28 Oct 2005 14:02:11 -0700
drivers/hwmon/atxp1.c | 2 ++
drivers/hwmon/ds1621.c | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c
index deb4d34..441324f 100644
--- a/drivers/hwmon/atxp1.c
+++ b/drivers/hwmon/atxp1.c
@@ -253,6 +253,8 @@ static DEVICE_ATTR(gpio2, S_IRUGO | S_IW
static int atxp1_attach_adapter(struct i2c_adapter *adapter)
{
+ if (!(adapter->class & I2C_CLASS_HWMON))
+ return 0;
return i2c_probe(adapter, &addr_data, &atxp1_detect);
};
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index b0199e0..e1ff22c 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -180,6 +180,8 @@ static DEVICE_ATTR(temp1_max, S_IWUSR |
static int ds1621_attach_adapter(struct i2c_adapter *adapter)
{
+ if (!(adapter->class & I2C_CLASS_HWMON))
+ return 0;
return i2c_probe(adapter, &addr_data, ds1621_detect);
}
reply other threads:[~2005-10-29 0:15 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=11305336621727@kroah.com \
--to=gregkh@suse.de \
--cc=lm-sensors@vger.kernel.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 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.