1
0
Fork 0
Commit Graph

5 Commits (41844e36206be90cd4d962ea49b0abc3612a99d0)

Author SHA1 Message Date
Julia Lawall 52ceb7731e iio: adc: men_z188_adc: constify iio_info structures
Check for iio_info structures that are only stored in the info field of a
iio_dev structure.  This field is declared const, so iio_info structures
that have this property can be declared as const also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct iio_info i@p = { ... };

@ok@
identifier r.i;
struct iio_dev e;
position p;
@@
e.info = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct iio_info e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct iio_info i = { ... };
// </smpl>

The result of size on this file before the change is:
   text	      data     bss     dec         hex	  filename
   1529	       312       0    1841         731
   drivers/iio/adc/men_z188_adc.o

and after the change it is:
   text	     data        bss	    dec	    hex	filename
   1689       168          0       1857     741
   drivers/iio/adc/men_z188_adc.o

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-09-18 11:58:31 +01:00
Axel Lin fbbba1f89e iio: adc: men_z188_adc: Add terminating entry for men_z188_ids
The mcb_device_id table is supposed to be zero-terminated.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-15 16:12:04 +00:00
Dan Carpenter e94f62e79f iio: adc: checking for NULL instead of IS_ERR() in probe
mcb_request_mem() returns an ERR_PTR(), it doesn't return NULL.

Fixes: 74aeac4da6 ('iio: adc: Add MEN 16z188 ADC driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Stable@vger.kernel.org
2014-06-14 16:16:43 +01:00
Johannes Thumshirn 35272754e2 iio: adc: Fix build error discovered by 0-day build bot
men_z188_adc needs to include linux/io.h. This fixes a build error
discovered by 0-day buid bot

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08 21:57:17 -08:00
Johannes Thumshirn 74aeac4da6 iio: adc: Add MEN 16z188 ADC driver
Add support for MEN 16z188 ADC IP Core on MCB FPGAs.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 15:47:57 -08:00