iio: example code is buggy
authorAlan <gnomes@lxorguk.ukuu.org.uk>
Wed, 8 Apr 2015 19:24:43 +0000 (20:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2015 14:57:32 +0000 (16:57 +0200)
Shock horror, example template code that has never been used in reality is
in fact a hazard. This fixes the obvious bug, probably these kind of
"examples" should be deleted so real (working) examples are followed.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/iio_simple_dummy_events.c

index a5cd3bb..c32ef78 100644 (file)
@@ -84,6 +84,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev,
                default:
                        return -EINVAL;
                }
+               break;
        case IIO_STEPS:
                switch (type) {
                case IIO_EV_TYPE_CHANGE:
@@ -92,6 +93,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev,
                default:
                        return -EINVAL;
                }
+               break;
        default:
                return -EINVAL;
        }