mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
hwmon: (i5k_amb) fix checkpatch issues
fixed: WARNING: simple_strtoul is obsolete, use kstrtoul instead + unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; WARNING: simple_strtoul is obsolete, use kstrtoul instead + unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; WARNING: simple_strtoul is obsolete, use kstrtoul instead + unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
This commit is contained in:
parent
600151b9de
commit
7b102ed660
1 changed files with 15 additions and 3 deletions
|
@ -159,8 +159,12 @@ static ssize_t store_amb_min(struct device *dev,
|
|||
{
|
||||
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
|
||||
struct i5k_amb_data *data = dev_get_drvdata(dev);
|
||||
unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
|
||||
unsigned long temp;
|
||||
int ret = kstrtoul(buf, 10, &temp);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
temp = temp / 500;
|
||||
if (temp > 255)
|
||||
temp = 255;
|
||||
|
||||
|
@ -175,8 +179,12 @@ static ssize_t store_amb_mid(struct device *dev,
|
|||
{
|
||||
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
|
||||
struct i5k_amb_data *data = dev_get_drvdata(dev);
|
||||
unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
|
||||
unsigned long temp;
|
||||
int ret = kstrtoul(buf, 10, &temp);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
temp = temp / 500;
|
||||
if (temp > 255)
|
||||
temp = 255;
|
||||
|
||||
|
@ -191,8 +199,12 @@ static ssize_t store_amb_max(struct device *dev,
|
|||
{
|
||||
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
|
||||
struct i5k_amb_data *data = dev_get_drvdata(dev);
|
||||
unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
|
||||
unsigned long temp;
|
||||
int ret = kstrtoul(buf, 10, &temp);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
temp = temp / 500;
|
||||
if (temp > 255)
|
||||
temp = 255;
|
||||
|
||||
|
|
Loading…
Reference in a new issue