diff options
Diffstat (limited to 'drivers/iio/industrialio-event.c')
-rw-r--r-- | drivers/iio/industrialio-event.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c index fa6543bf6731..261cae00557e 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c | |||
@@ -239,13 +239,13 @@ static ssize_t iio_ev_value_store(struct device *dev, | |||
239 | { | 239 | { |
240 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 240 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
241 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | 241 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); |
242 | unsigned long val; | 242 | int val; |
243 | int ret; | 243 | int ret; |
244 | 244 | ||
245 | if (!indio_dev->info->write_event_value) | 245 | if (!indio_dev->info->write_event_value) |
246 | return -EINVAL; | 246 | return -EINVAL; |
247 | 247 | ||
248 | ret = strict_strtoul(buf, 10, &val); | 248 | ret = kstrtoint(buf, 10, &val); |
249 | if (ret) | 249 | if (ret) |
250 | return ret; | 250 | return ret; |
251 | 251 | ||
@@ -350,15 +350,10 @@ static inline int __iio_add_event_config_attrs(struct iio_dev *indio_dev) | |||
350 | ret = iio_device_add_event_sysfs(indio_dev, | 350 | ret = iio_device_add_event_sysfs(indio_dev, |
351 | &indio_dev->channels[j]); | 351 | &indio_dev->channels[j]); |
352 | if (ret < 0) | 352 | if (ret < 0) |
353 | goto error_clear_attrs; | 353 | return ret; |
354 | attrcount += ret; | 354 | attrcount += ret; |
355 | } | 355 | } |
356 | return attrcount; | 356 | return attrcount; |
357 | |||
358 | error_clear_attrs: | ||
359 | __iio_remove_event_config_attrs(indio_dev); | ||
360 | |||
361 | return ret; | ||
362 | } | 357 | } |
363 | 358 | ||
364 | static bool iio_check_for_dynamic_events(struct iio_dev *indio_dev) | 359 | static bool iio_check_for_dynamic_events(struct iio_dev *indio_dev) |