2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 02:34:01 +08:00

hwmon updates/fixes for v4.15 - take 2

Minor bug fix in k10temp driver
 Take advantage of added NULL check in i2c_unregister_device()
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJaD6chAAoJEMsfJm/On5mBPiMQAJz7i72X5ABrK3kVAQSOQBj1
 4udBDYEL7z73YP6i4ZaJovK5iPyY4+xI/vpYMu4QQihW9/xzONsyjQJWhATO1Tas
 D1T8uQz6dyICpd/0pe/ehgcZCR+8o3RPkB6o9bn9rl0uoYPofASqtaVrntdEHp5H
 IyQfvebNNZDfZ1zCZ4SzX6SJV4YVYqz9O51iQburSGwIPOxgUdhD00ijoAkBr9o1
 FG2bAAoxruPIf67INevgziUVULXBnzkZbcXaLsr/KNdNFYtevSSsAuTVSwkmyU+1
 +CRx2MB/J2SC9dqBr6cRgoerMRStJNNtqSFPcfossxnjNe98gBV6ocAvVCcIysPe
 pb2cP1SS9wk96sQUeNueV53SgjIUSWrzwDnt052LfCGDChqxBaQ4xuii9ZkIexFw
 Whz00D8m5UN12E5fvPYSZPdnLZqmmkEkxZmGJbHqPmOskhDTsSqyepqXCLahHUzy
 Va3s322rUjdmpzP8Jkq/GPa52RuL2IN1jmkwrwzPAPoTtpsFhpd+/Npog0V6xyLT
 URGBt2gDmi+Kh9hbzwrvBzC3Hp/4pWAjGZDdFbWkjINOPwJ20tNHSUyN3NhK0sYS
 VJ3+XzmXAP2RtZ4AezRkSB0gwq7ISJV2CfJVi50VH0CMKmvBGYzsGLoTx10q3NdY
 eKODG3HQm/NHbsZeizSJ
 =Pj9u
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus-v4.15-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull more hwmon updates/fixes from Guenter Roeck:

 - minor bug fix in k10temp driver

 - take advantage of added NULL check in i2c_unregister_device()

* tag 'hwmon-for-linus-v4.15-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (w83793) Remove duplicate NULL check
  hwmon: (w83792d) Remove duplicate NULL check
  hwmon: (w83791d) Remove duplicate NULL check
  hwmon: (w83781d) Remove duplicate NULL check
  hwmon: (k10temp) Correct model name for Ryzen 1600X
This commit is contained in:
Linus Torvalds 2017-11-17 20:10:05 -08:00
commit d9ef1ccf7c
5 changed files with 20 additions and 39 deletions

View File

@ -81,7 +81,7 @@ struct tctl_offset {
};
static const struct tctl_offset tctl_offset_table[] = {
{ 0x17, "AMD Ryzen 7 1600X", 20000 },
{ 0x17, "AMD Ryzen 5 1600X", 20000 },
{ 0x17, "AMD Ryzen 7 1700X", 20000 },
{ 0x17, "AMD Ryzen 7 1800X", 20000 },
{ 0x17, "AMD Ryzen Threadripper 1950X", 27000 },

View File

@ -1246,10 +1246,8 @@ w83781d_probe(struct i2c_client *client, const struct i2c_device_id *id)
exit_remove_files:
w83781d_remove_files(dev);
if (data->lm75[0])
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1])
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[1]);
return err;
}
@ -1262,10 +1260,8 @@ w83781d_remove(struct i2c_client *client)
hwmon_device_unregister(data->hwmon_dev);
w83781d_remove_files(dev);
if (data->lm75[0])
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1])
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[1]);
return 0;
}

View File

@ -1316,8 +1316,7 @@ static int w83791d_detect_subclients(struct i2c_client *client)
/* Undo inits in case of errors */
error_sc_1:
if (data->lm75[0] != NULL)
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]);
error_sc_0:
return err;
}
@ -1434,10 +1433,8 @@ error5:
error4:
sysfs_remove_group(&client->dev.kobj, &w83791d_group);
error3:
if (data->lm75[0] != NULL)
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[1]);
return err;
}
@ -1448,10 +1445,8 @@ static int w83791d_remove(struct i2c_client *client)
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &w83791d_group);
if (data->lm75[0] != NULL)
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[1]);
return 0;
}

View File

@ -981,8 +981,7 @@ w83792d_detect_subclients(struct i2c_client *new_client)
/* Undo inits in case of errors */
ERROR_SC_1:
if (data->lm75[0] != NULL)
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]);
ERROR_SC_0:
return err;
}
@ -1456,10 +1455,8 @@ exit_remove_files:
for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++)
sysfs_remove_group(&dev->kobj, &w83792d_group_fan[i]);
exit_i2c_unregister:
if (data->lm75[0] != NULL)
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[1]);
return err;
}
@ -1475,10 +1472,8 @@ w83792d_remove(struct i2c_client *client)
sysfs_remove_group(&client->dev.kobj,
&w83792d_group_fan[i]);
if (data->lm75[0] != NULL)
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[1]);
return 0;
}

View File

@ -1564,10 +1564,8 @@ static int w83793_remove(struct i2c_client *client)
for (i = 0; i < ARRAY_SIZE(w83793_temp); i++)
device_remove_file(dev, &w83793_temp[i].dev_attr);
if (data->lm75[0] != NULL)
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[1]);
/* Decrease data reference counter */
mutex_lock(&watchdog_data_mutex);
@ -1625,8 +1623,7 @@ w83793_detect_subclients(struct i2c_client *client)
/* Undo inits in case of errors */
ERROR_SC_1:
if (data->lm75[0] != NULL)
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[0]);
ERROR_SC_0:
return err;
}
@ -1962,10 +1959,8 @@ exit_remove:
for (i = 0; i < ARRAY_SIZE(w83793_temp); i++)
device_remove_file(dev, &w83793_temp[i].dev_attr);
if (data->lm75[0] != NULL)
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);
i2c_unregister_device(data->lm75[1]);
free_mem:
kfree(data);
exit: