diff options
-rw-r--r-- | drivers/iio/industrialio-event.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c index 857e6306c5c3..261cae00557e 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c | |||
@@ -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) |