From: Guenter Roeck <linux@roeck-us.net>
To: Hardware Monitoring <linux-hwmon@vger.kernel.org>
Cc: Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Subject: [PATCH 1/3] hwmon: (adm9240) Drop log messages from detect function
Date: Wed, 10 Mar 2021 23:33:00 -0800 [thread overview]
Message-ID: <20210311073302.221954-1-linux@roeck-us.net> (raw)
Not detecting a chip in the detect function is normal and should not
generate any log messages, much less error messages.
Cc: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/hwmon/adm9240.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index cc3e0184e720..3bbdd662c9e4 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -730,26 +730,19 @@ static int adm9240_detect(struct i2c_client *new_client,
return -ENODEV;
/* verify chip: reg address should match i2c address */
- if (i2c_smbus_read_byte_data(new_client, ADM9240_REG_I2C_ADDR)
- != address) {
- dev_err(&adapter->dev, "detect fail: address match, 0x%02x\n",
- address);
+ if (i2c_smbus_read_byte_data(new_client, ADM9240_REG_I2C_ADDR) != address)
return -ENODEV;
- }
/* check known chip manufacturer */
man_id = i2c_smbus_read_byte_data(new_client, ADM9240_REG_MAN_ID);
- if (man_id == 0x23) {
+ if (man_id == 0x23)
name = "adm9240";
- } else if (man_id == 0xda) {
+ else if (man_id == 0xda)
name = "ds1780";
- } else if (man_id == 0x01) {
+ else if (man_id == 0x01)
name = "lm81";
- } else {
- dev_err(&adapter->dev, "detect fail: unknown manuf, 0x%02x\n",
- man_id);
+ else
return -ENODEV;
- }
/* successful detect, print chip info */
die_rev = i2c_smbus_read_byte_data(new_client, ADM9240_REG_DIE_REV);
--
2.17.1
next reply other threads:[~2021-03-11 7:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 7:33 Guenter Roeck [this message]
2021-03-11 7:33 ` [PATCH 2/3] hwmon: (adm9240) Store i2c device instead of client in local data Guenter Roeck
2021-03-11 21:10 ` Chris Packham
2021-03-11 7:33 ` [PATCH 3/3] hwmon: (adm9240) Convert to devm_hwmon_device_register_with_info API Guenter Roeck
2021-03-11 21:10 ` Chris Packham
2021-05-12 21:54 ` Chris Packham
2021-05-12 22:09 ` Guenter Roeck
2021-05-12 22:35 ` Guenter Roeck
2021-05-12 22:41 ` Chris Packham
2021-05-12 22:51 ` Guenter Roeck
2021-05-12 22:58 ` Chris Packham
2021-03-11 21:09 ` [PATCH 1/3] hwmon: (adm9240) Drop log messages from detect function Chris Packham
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=20210311073302.221954-1-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Chris.Packham@alliedtelesis.co.nz \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).