Skip to contentSkip to conversation

hwmon: (pmbus) Drop check for PMBus

PATCH In review Guenter Roeck 2 participants 5 messages Jun 30, 2011 – Jul 3, 2011 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 hwmon: (pmbus) Drop check for PMBus

Some PMBus devices do not support the PMBus revision register, so don't check if it exists.

---
 drivers/hwmon/pmbus_core.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
drivers/hwmon/pmbus_core.c +2 -6
index 354770e..bd613e7 100644
@@ -1430,12 +1430,8 @@ int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id,
 	i2c_set_clientdata(client, data);
 	mutex_init(&data->update_lock);
 
-	/*
-	 * Bail out if status register or PMBus revision register
-	 * does not exist.
-	 */
-	if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0
-	    || i2c_smbus_read_byte_data(client, PMBUS_REVISION) < 0) {
+	/* Bail out if PMBus status register does not exist. */
+	if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0) {
 		dev_err(&client->dev,
 			"Status or revision register not found\n");
 		ret = -ENODEV;
Signature · 7 lines
1.7.3.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw

Hi Guenter,

Sorry for the (too) late review.

Quoted 2 lines · Guenter Roeck

Some PMBus devices do not support the PMBus revision register, so don't check if it exists.

This was the only use of PMBUS_REVISION. Should its definition be kept in pmbus.h?

Quoted 13 lines
---
 drivers/hwmon/pmbus_core.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
drivers/hwmon/pmbus_core.c +0 -0
index 354770e..bd613e7 100644
@@ -1430,12 +1430,8 @@ int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id,
 	i2c_set_clientdata(client, data);
 	mutex_init(&data->update_lock);
 

drivers/hwmon/pmbus_core.c int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id, · line 1436

Quoted 10 lines
drivers/hwmon/pmbus_core.c +2 -6
-	/*
-	 * Bail out if status register or PMBus revision register
-	 * does not exist.
-	 */
-	if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0
-	    || i2c_smbus_read_byte_data(client, PMBUS_REVISION) < 0) {
+	/* Bail out if PMBus status register does not exist. */
+	if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0) {
 		dev_err(&client->dev,
 			"Status or revision register not found\n");

This error message should be updated accordingly.

Quoted 1 line
drivers/hwmon/pmbus_core.c +0 -0
 		ret = -ENODEV;
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw
In reply to Guenter Roeck

Hi Jean,

Quoted 11 lines · Jean Delvare

Hi Guenter,

Sorry for the (too) late review.

Quoted 2 lines · Guenter Roeck

Some PMBus devices do not support the PMBus revision register, so don't check if it exists.

This was the only use of PMBUS_REVISION. Should its definition be kept in pmbus.h?

I'd like to keep it at least for now. Who knows what I may need it for.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#3 lore raw
In reply to Guenter Roeck
Quoted 24 lines · Jean Delvare

Hi Guenter,

Sorry for the (too) late review.

Quoted 2 lines · Guenter Roeck

Some PMBus devices do not support the PMBus revision register, so don't check if it exists.

This was the only use of PMBUS_REVISION. Should its definition be kept in pmbus.h?

Quoted 13 lines
---
 drivers/hwmon/pmbus_core.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
drivers/hwmon/pmbus_core.c +0 -0
index 354770e..bd613e7 100644
@@ -1430,12 +1430,8 @@ int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id,
 	i2c_set_clientdata(client, data);
 	mutex_init(&data->update_lock);
 
Quoted 13 lines

drivers/hwmon/pmbus_core.c int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id, · line 1436

Quoted 10 lines
drivers/hwmon/pmbus_core.c +2 -6
-	/*
-	 * Bail out if status register or PMBus revision register
-	 * does not exist.
-	 */
-	if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0
-	    || i2c_smbus_read_byte_data(client, PMBUS_REVISION) < 0) {
+	/* Bail out if PMBus status register does not exist. */
+	if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0) {
 		dev_err(&client->dev,
 			"Status or revision register not found\n");

This error message should be updated accordingly.

Forgot to mention: I fixed that before I sent the patch to Linus. Sorry, things are a bit hectic nowadays and I forgot to send the updated patch to the list.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#4 lore raw
In reply to Guenter Roeck
Quoted 38 lines · Guenter Roeck
Quoted 24 lines · Jean Delvare

Hi Guenter,

Sorry for the (too) late review.

Quoted 2 lines · Guenter Roeck

Some PMBus devices do not support the PMBus revision register, so don't check if it exists.

This was the only use of PMBUS_REVISION. Should its definition be kept in pmbus.h?

Quoted 13 lines
---
 drivers/hwmon/pmbus_core.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
drivers/hwmon/pmbus_core.c +0 -0
index 354770e..bd613e7 100644
@@ -1430,12 +1430,8 @@ int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id,
 	i2c_set_clientdata(client, data);
 	mutex_init(&data->update_lock);
 
Quoted 13 lines

drivers/hwmon/pmbus_core.c int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id, · line 1436

Quoted 10 lines
drivers/hwmon/pmbus_core.c +2 -6
-	/*
-	 * Bail out if status register or PMBus revision register
-	 * does not exist.
-	 */
-	if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0
-	    || i2c_smbus_read_byte_data(client, PMBUS_REVISION) < 0) {
+	/* Bail out if PMBus status register does not exist. */
+	if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0) {
 		dev_err(&client->dev,
 			"Status or revision register not found\n");

This error message should be updated accordingly.

Quoted 3 lines

Forgot to mention: I fixed that before I sent the patch to Linus. Sorry, things are a bit hectic nowadays and I forgot to send the updated patch to the list.

Perfect then :)

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors