[PATCH 2/3] hwmon: (pmbus) use block presence checking for registers PMBUS_MFR_*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When PEC is enabled, using the function to check byte register presence
(pmbus_check_byte_register) for block register generates an error.
The second byte of a block is interpreted as PEC, which is usually wrong.

Signed-off-by: Adam Wujek <dev_public@xxxxxxxx>
---
Note:
- This commit requires commit which is accepted, but not yet in the kernel
  tree:
  hwmon: (pmbus) add MFR_* registers to debugfs

 drivers/hwmon/pmbus/pmbus_core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 2634ac1fa3d5..597cbe85df07 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -2858,7 +2858,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
 					    &pmbus_debugfs_ops);
 		}

-		if (pmbus_check_byte_register(client, i, PMBUS_MFR_ID)) {
+		if (pmbus_check_block_register(client, i, PMBUS_MFR_ID)) {
 			entries[idx].client = client;
 			entries[idx].page = i;
 			entries[idx].reg = PMBUS_MFR_ID;
@@ -2868,7 +2868,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
 					    &pmbus_debugfs_ops_mfr);
 		}

-		if (pmbus_check_byte_register(client, i, PMBUS_MFR_MODEL)) {
+		if (pmbus_check_block_register(client, i, PMBUS_MFR_MODEL)) {
 			entries[idx].client = client;
 			entries[idx].page = i;
 			entries[idx].reg = PMBUS_MFR_MODEL;
@@ -2878,7 +2878,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
 					    &pmbus_debugfs_ops_mfr);
 		}

-		if (pmbus_check_byte_register(client, i, PMBUS_MFR_REVISION)) {
+		if (pmbus_check_block_register(client, i, PMBUS_MFR_REVISION)) {
 			entries[idx].client = client;
 			entries[idx].page = i;
 			entries[idx].reg = PMBUS_MFR_REVISION;
@@ -2888,7 +2888,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
 					    &pmbus_debugfs_ops_mfr);
 		}

-		if (pmbus_check_byte_register(client, i, PMBUS_MFR_LOCATION)) {
+		if (pmbus_check_block_register(client, i, PMBUS_MFR_LOCATION)) {
 			entries[idx].client = client;
 			entries[idx].page = i;
 			entries[idx].reg = PMBUS_MFR_LOCATION;
@@ -2898,7 +2898,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
 					    &pmbus_debugfs_ops_mfr);
 		}

-		if (pmbus_check_byte_register(client, i, PMBUS_MFR_DATE)) {
+		if (pmbus_check_block_register(client, i, PMBUS_MFR_DATE)) {
 			entries[idx].client = client;
 			entries[idx].page = i;
 			entries[idx].reg = PMBUS_MFR_DATE;
@@ -2908,7 +2908,7 @@ static int pmbus_init_debugfs(struct i2c_client *client,
 					    &pmbus_debugfs_ops_mfr);
 		}

-		if (pmbus_check_byte_register(client, i, PMBUS_MFR_SERIAL)) {
+		if (pmbus_check_block_register(client, i, PMBUS_MFR_SERIAL)) {
 			entries[idx].client = client;
 			entries[idx].page = i;
 			entries[idx].reg = PMBUS_MFR_SERIAL;
--
2.17.1






[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux