--- zzzz-none-000/linux-3.10.107/drivers/hwmon/lm87.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/hwmon/lm87.c 2021-02-04 17:41:59.000000000 +0000 @@ -5,7 +5,7 @@ * Philip Edelbrock * Stephen Rousset * Dan Eaton - * Copyright (C) 2004-2008 Jean Delvare + * Copyright (C) 2004-2008 Jean Delvare * * Original port to Linux 2.6 by Jeff Oliver. * @@ -617,6 +617,10 @@ err = kstrtoul(buf, 10, &val); if (err) return err; + + if (val > 255) + return -EINVAL; + data->vrm = val; return count; } @@ -855,8 +859,8 @@ { struct lm87_data *data = i2c_get_clientdata(client); - if (client->dev.platform_data) { - data->channel = *(u8 *)client->dev.platform_data; + if (dev_get_platdata(&client->dev)) { + data->channel = *(u8 *)dev_get_platdata(&client->dev); lm87_write_value(client, LM87_REG_CHANNEL_MODE, data->channel); } else { @@ -903,7 +907,6 @@ return -ENOMEM; i2c_set_clientdata(client, data); - data->valid = 0; mutex_init(&data->update_lock); /* Initialize the LM87 chip */ @@ -1011,6 +1014,6 @@ module_i2c_driver(lm87_driver); -MODULE_AUTHOR("Jean Delvare and others"); +MODULE_AUTHOR("Jean Delvare and others"); MODULE_DESCRIPTION("LM87 driver"); MODULE_LICENSE("GPL");