mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
hwmon: (w83791d) Remove duplicate NULL check
Since i2c_unregister_device() became NULL-aware we may remove duplicate NULL check. Cc: Marc Hulsman <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
This commit is contained in:
parent
0ab21d0edb
commit
416c2a6a6b
1 changed files with 5 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue