Skip to contentSkip to conversation

iio: dummy: events: Add missing break

PATCH Applied Lars-Peter Clausen 2 participants 2 messages Sep 29, 2017 – Oct 1, 2017 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: dummy: events: Add missing break

Add missing break in iio_simple_dummy_write_event_config() for the voltage threshold event enable attribute. Without this writing to the in_voltage0_thresh_rising_en always returns -EINVAL even though the change was correctly applied.

Fixes 3e34e650db197 ("iio: dummy: Demonstrate the usage of new channel types")
---
 drivers/iio/dummy/iio_simple_dummy_events.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/dummy/iio_simple_dummy_events.c +1 -0
index ed63ffd849f8..7ec2a0bb0807 100644
@@ -72,6 +72,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev,
 				st->event_en = state;
 			else
 				return -EINVAL;
+			break;
 		default:
 			return -EINVAL;
 		}
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw
Quoted 7 lines · On Fri, 29 Sep 2017 15:24:05 +0200 Lars-Peter Clausen <[email protected]> wrote:

Add missing break in iio_simple_dummy_write_event_config() for the voltage threshold event enable attribute. Without this writing to the in_voltage0_thresh_rising_en always returns -EINVAL even though the change was correctly applied.

Fixes 3e34e650db197 ("iio: dummy: Demonstrate the usage of new channel types")

Applied to the fixes-togreg branch of iio.git and marked for stable. It's hardly a critical stable fix, but the risk is obviously very low as well ;)

Thanks,

Jonathan

Quoted 16 lines
---
 drivers/iio/dummy/iio_simple_dummy_events.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/dummy/iio_simple_dummy_events.c +1 -0
index ed63ffd849f8..7ec2a0bb0807 100644
@@ -72,6 +72,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev,
 				st->event_en = state;
 			else
 				return -EINVAL;
+			break;
 		default:
 			return -EINVAL;
 		}