{
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;
{
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;
{
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;