Source
1239
1239
data->hwmon_dev = hwmon_device_register(dev);
1240
1240
if (IS_ERR(data->hwmon_dev)) {
1241
1241
err = PTR_ERR(data->hwmon_dev);
1242
1242
goto exit_remove_files;
1243
1243
}
1244
1244
1245
1245
return 0;
1246
1246
1247
1247
exit_remove_files:
1248
1248
w83781d_remove_files(dev);
1249
-
if (data->lm75[0])
1250
-
i2c_unregister_device(data->lm75[0]);
1251
-
if (data->lm75[1])
1252
-
i2c_unregister_device(data->lm75[1]);
1249
+
i2c_unregister_device(data->lm75[0]);
1250
+
i2c_unregister_device(data->lm75[1]);
1253
1251
return err;
1254
1252
}
1255
1253
1256
1254
static int
1257
1255
w83781d_remove(struct i2c_client *client)
1258
1256
{
1259
1257
struct w83781d_data *data = i2c_get_clientdata(client);
1260
1258
struct device *dev = &client->dev;
1261
1259
1262
1260
hwmon_device_unregister(data->hwmon_dev);
1263
1261
w83781d_remove_files(dev);
1264
1262
1265
-
if (data->lm75[0])
1266
-
i2c_unregister_device(data->lm75[0]);
1267
-
if (data->lm75[1])
1268
-
i2c_unregister_device(data->lm75[1]);
1263
+
i2c_unregister_device(data->lm75[0]);
1264
+
i2c_unregister_device(data->lm75[1]);
1269
1265
1270
1266
return 0;
1271
1267
}
1272
1268
1273
1269
static int
1274
1270
w83781d_read_value_i2c(struct w83781d_data *data, u16 reg)
1275
1271
{
1276
1272
struct i2c_client *client = data->client;
1277
1273
int res, bank;
1278
1274
struct i2c_client *cl;