aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/w83781d.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index c11452ebe18f..5a5046d94c3e 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -867,6 +867,7 @@ w83781d_detect_subclients(struct i2c_client *new_client)
867 struct i2c_adapter *adapter = new_client->adapter; 867 struct i2c_adapter *adapter = new_client->adapter;
868 struct w83781d_data *data = i2c_get_clientdata(new_client); 868 struct w83781d_data *data = i2c_get_clientdata(new_client);
869 enum chips kind = data->type; 869 enum chips kind = data->type;
870 int num_sc = 1;
870 871
871 id = i2c_adapter_id(adapter); 872 id = i2c_adapter_id(adapter);
872 873
@@ -891,6 +892,7 @@ w83781d_detect_subclients(struct i2c_client *new_client)
891 } 892 }
892 893
893 if (kind != w83783s) { 894 if (kind != w83783s) {
895 num_sc = 2;
894 if (force_subclients[0] == id && 896 if (force_subclients[0] == id &&
895 force_subclients[1] == address) { 897 force_subclients[1] == address) {
896 sc_addr[1] = force_subclients[3]; 898 sc_addr[1] = force_subclients[3];
@@ -906,7 +908,7 @@ w83781d_detect_subclients(struct i2c_client *new_client)
906 } 908 }
907 } 909 }
908 910
909 for (i = 0; i <= 1; i++) { 911 for (i = 0; i < num_sc; i++) {
910 data->lm75[i] = i2c_new_dummy(adapter, sc_addr[i]); 912 data->lm75[i] = i2c_new_dummy(adapter, sc_addr[i]);
911 if (!data->lm75[i]) { 913 if (!data->lm75[i]) {
912 dev_err(&new_client->dev, "Subclient %d " 914 dev_err(&new_client->dev, "Subclient %d "
@@ -917,8 +919,6 @@ w83781d_detect_subclients(struct i2c_client *new_client)
917 goto ERROR_SC_3; 919 goto ERROR_SC_3;
918 goto ERROR_SC_2; 920 goto ERROR_SC_2;
919 } 921 }
920 if (kind == w83783s)
921 break;
922 } 922 }
923 923
924 return 0; 924 return 0;