Skip to contentSkip to conversation

staging:iio:ad7291: Move out of staging

PATCH Applied Lars-Peter Clausen 3 participants 4 messages Jun 30, 2014 – Jul 8, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging:iio:ad7291: Move out of staging

The ad7291 driver is in a reasonable shape. It does not use non-standard API/ABI and there are no major style issues with the driver. So this patch moves it out of staging.

There is one small warning from checkpatch which is also fixed in this patch. The patch also sorts the #include directives in alphabetical order.

---
 drivers/iio/adc/Kconfig                                     | 10 ++++++++++
 drivers/iio/adc/Makefile                                    |  1 +
 drivers/{staging => }/iio/adc/ad7291.c                      | 13 +++++++------
 drivers/staging/iio/adc/Kconfig                             |  7 -------
 drivers/staging/iio/adc/Makefile                            |  1 -
 .../iio/adc => include/linux/platform_data}/ad7291.h        |  0
 6 files changed, 18 insertions(+), 14 deletions(-)
 rename drivers/{staging => }/iio/adc/ad7291.c (99%)
 rename {drivers/staging/iio/adc => include/linux/platform_data}/ad7291.h (100%)
drivers/iio/adc/Kconfig +10 -0
index 20a7073..11b048a 100644
@@ -20,6 +20,16 @@ config AD7266
 	  Say yes here to build support for Analog Devices AD7265 and AD7266
 	  ADCs.
 
+config AD7291
+	tristate "Analog Devices AD7291 ADC driver"
+	depends on I2C
+	help
+	  Say yes here to build support for Analog Devices AD7291
+	  8 Channel ADC with temperature sensor.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ad7291.
+
 config AD7298
 	tristate "Analog Devices AD7298 ADC driver"
 	depends on SPI
drivers/iio/adc/Makefile +1 -0
index 38cf5c3..ad81b51 100644
@@ -5,6 +5,7 @@
 # When adding new entries keep the list in alphabetical order
 obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o
 obj-$(CONFIG_AD7266) += ad7266.o
+obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7298) += ad7298.o
 obj-$(CONFIG_AD7923) += ad7923.o
 obj-$(CONFIG_AD7476) += ad7476.o
drivers/iio/adc/ad7291.c renamed from drivers/staging/iio/adc/ad7291.c +7 -6
similarity index 99%
rename from drivers/staging/iio/adc/ad7291.c
rename to drivers/iio/adc/ad7291.c
index 357cef2..1728e68 100644
@@ -6,22 +6,22 @@
  * Licensed under the GPL-2 or later.
  */
 
-#include <linux/interrupt.h>
 #include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
+#include <linux/err.h>
 #include <linux/i2c.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/regulator/consumer.h>
-#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/sysfs.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/iio/events.h>
 
-#include "ad7291.h"
+#include <linux/platform_data/ad7291.h>
 
 /*
  * Simplified handling
@@ -375,6 +375,7 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
 		case IIO_VOLTAGE:
 			if (chip->reg) {
 				int vref;
+
 				vref = regulator_get_voltage(chip->reg);
 				if (vref < 0)
 					return vref;
drivers/staging/iio/adc/Kconfig +0 -7
index b87e382..75d2d1b 100644
@@ -3,13 +3,6 @@
 #
 menu "Analog to digital converters"
 
-config AD7291
-	tristate "Analog Devices AD7291 ADC driver"
-	depends on I2C
-	help
-	  Say yes here to build support for Analog Devices AD7291
-	  8 Channel ADC with temperature sensor.
-
 config AD7606
 	tristate "Analog Devices AD7606 ADC driver"
 	depends on GPIOLIB
drivers/staging/iio/adc/Makefile +0 -1
index afdcd1f..1c4277d 100644
@@ -8,7 +8,6 @@ ad7606-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
 ad7606-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
 obj-$(CONFIG_AD7606) += ad7606.o
 
-obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7780) += ad7780.o
 obj-$(CONFIG_AD7816) += ad7816.o
 obj-$(CONFIG_AD7192) += ad7192.o
include/linux/platform_data/ad7291.h renamed from drivers/staging/iio/adc/ad7291.h +0 -0
similarity index 100%
rename from drivers/staging/iio/adc/ad7291.h
rename to include/linux/platform_data/ad7291.h
Signature · 1 line
1.8.0
#1 lore raw
Quoted 6 lines · Lars-Peter Clausen

The ad7291 driver is in a reasonable shape. It does not use non-standard API/ABI and there are no major style issues with the driver. So this patch moves it out of staging.

There is one small warning from checkpatch which is also fixed in this patch. The patch also sorts the #include directives in alphabetical order.

So far, I just took a quick peek into the drivers sources and hope to find some more time for a review later this weekend. But one style issue caught my attention, which I would prefer to have fixed before moving out of staging: the double indentations in ad7291_threshold_reg().

Quoted 124 lines
---
 drivers/iio/adc/Kconfig                                     | 10 ++++++++++
 drivers/iio/adc/Makefile                                    |  1 +
 drivers/{staging => }/iio/adc/ad7291.c                      | 13 +++++++------
 drivers/staging/iio/adc/Kconfig                             |  7 -------
 drivers/staging/iio/adc/Makefile                            |  1 -
 .../iio/adc => include/linux/platform_data}/ad7291.h        |  0
 6 files changed, 18 insertions(+), 14 deletions(-)
 rename drivers/{staging => }/iio/adc/ad7291.c (99%)
 rename {drivers/staging/iio/adc => include/linux/platform_data}/ad7291.h (100%)
drivers/iio/adc/Kconfig +10 -0
index 20a7073..11b048a 100644
@@ -20,6 +20,16 @@ config AD7266
 	  Say yes here to build support for Analog Devices AD7265 and AD7266
 	  ADCs.
 
+config AD7291
+	tristate "Analog Devices AD7291 ADC driver"
+	depends on I2C
+	help
+	  Say yes here to build support for Analog Devices AD7291
+	  8 Channel ADC with temperature sensor.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ad7291.
+
 config AD7298
 	tristate "Analog Devices AD7298 ADC driver"
 	depends on SPI
drivers/iio/adc/Makefile +1 -0
index 38cf5c3..ad81b51 100644
@@ -5,6 +5,7 @@
 # When adding new entries keep the list in alphabetical order
 obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o
 obj-$(CONFIG_AD7266) += ad7266.o
+obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7298) += ad7298.o
 obj-$(CONFIG_AD7923) += ad7923.o
 obj-$(CONFIG_AD7476) += ad7476.o
drivers/iio/adc/ad7291.c renamed from drivers/staging/iio/adc/ad7291.c +7 -6
similarity index 99%
rename from drivers/staging/iio/adc/ad7291.c
rename to drivers/iio/adc/ad7291.c
index 357cef2..1728e68 100644
@@ -6,22 +6,22 @@
  * Licensed under the GPL-2 or later.
  */
 
-#include <linux/interrupt.h>
 #include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
+#include <linux/err.h>
 #include <linux/i2c.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/regulator/consumer.h>
-#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/sysfs.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/iio/events.h>
 
-#include "ad7291.h"
+#include <linux/platform_data/ad7291.h>
 
 /*
  * Simplified handling
@@ -375,6 +375,7 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
 		case IIO_VOLTAGE:
 			if (chip->reg) {
 				int vref;
+
 				vref = regulator_get_voltage(chip->reg);
 				if (vref < 0)
 					return vref;
drivers/staging/iio/adc/Kconfig +0 -7
index b87e382..75d2d1b 100644
@@ -3,13 +3,6 @@
 #
 menu "Analog to digital converters"
 
-config AD7291
-	tristate "Analog Devices AD7291 ADC driver"
-	depends on I2C
-	help
-	  Say yes here to build support for Analog Devices AD7291
-	  8 Channel ADC with temperature sensor.
-
 config AD7606
 	tristate "Analog Devices AD7606 ADC driver"
 	depends on GPIOLIB
drivers/staging/iio/adc/Makefile +0 -1
index afdcd1f..1c4277d 100644
@@ -8,7 +8,6 @@ ad7606-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
 ad7606-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
 obj-$(CONFIG_AD7606) += ad7606.o
 
-obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7780) += ad7780.o
 obj-$(CONFIG_AD7816) += ad7816.o
 obj-$(CONFIG_AD7192) += ad7192.o
include/linux/platform_data/ad7291.h renamed from drivers/staging/iio/adc/ad7291.h +0 -0
similarity index 100%
rename from drivers/staging/iio/adc/ad7291.h
rename to include/linux/platform_data/ad7291.h
#2 lore raw
Quoted 8 lines · Hartmut Knaack
Quoted 6 lines · Lars-Peter Clausen

The ad7291 driver is in a reasonable shape. It does not use non-standard API/ABI and there are no major style issues with the driver. So this patch moves it out of staging.

There is one small warning from checkpatch which is also fixed in this patch. The patch also sorts the #include directives in alphabetical order.

So far, I just took a quick peek into the drivers sources and hope to find some more time for a review later this weekend. But one style issue caught my attention, which I would prefer to have fixed before moving out of staging: the double indentations in ad7291_threshold_reg().

I finally found the time to review the driver and found some minor issues. No show stoppers, but things we might want to fix before moving out of staging. I just sent out some fixes, so it might be a good idea to apply them first (they should not touch areas of this patch).

Quoted 128 lines

include/linux/platform_data/ad7291.h

Quoted 123 lines
---
 drivers/iio/adc/Kconfig                                     | 10 ++++++++++
 drivers/iio/adc/Makefile                                    |  1 +
 drivers/{staging => }/iio/adc/ad7291.c                      | 13 +++++++------
 drivers/staging/iio/adc/Kconfig                             |  7 -------
 drivers/staging/iio/adc/Makefile                            |  1 -
 .../iio/adc => include/linux/platform_data}/ad7291.h        |  0
 6 files changed, 18 insertions(+), 14 deletions(-)
 rename drivers/{staging => }/iio/adc/ad7291.c (99%)
 rename {drivers/staging/iio/adc => include/linux/platform_data}/ad7291.h (100%)
drivers/iio/adc/Kconfig +10 -0
index 20a7073..11b048a 100644
@@ -20,6 +20,16 @@ config AD7266
 	  Say yes here to build support for Analog Devices AD7265 and AD7266
 	  ADCs.
 
+config AD7291
+	tristate "Analog Devices AD7291 ADC driver"
+	depends on I2C
+	help
+	  Say yes here to build support for Analog Devices AD7291
+	  8 Channel ADC with temperature sensor.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ad7291.
+
 config AD7298
 	tristate "Analog Devices AD7298 ADC driver"
 	depends on SPI
drivers/iio/adc/Makefile +1 -0
index 38cf5c3..ad81b51 100644
@@ -5,6 +5,7 @@
 # When adding new entries keep the list in alphabetical order
 obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o
 obj-$(CONFIG_AD7266) += ad7266.o
+obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7298) += ad7298.o
 obj-$(CONFIG_AD7923) += ad7923.o
 obj-$(CONFIG_AD7476) += ad7476.o
drivers/iio/adc/ad7291.c renamed from drivers/staging/iio/adc/ad7291.c +7 -6
similarity index 99%
rename from drivers/staging/iio/adc/ad7291.c
rename to drivers/iio/adc/ad7291.c
index 357cef2..1728e68 100644
@@ -6,22 +6,22 @@
  * Licensed under the GPL-2 or later.
  */
 
-#include <linux/interrupt.h>
 #include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
+#include <linux/err.h>
 #include <linux/i2c.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/regulator/consumer.h>
-#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/sysfs.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/iio/events.h>
 
-#include "ad7291.h"
+#include <linux/platform_data/ad7291.h>
 
 /*
  * Simplified handling
@@ -375,6 +375,7 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
 		case IIO_VOLTAGE:
 			if (chip->reg) {
 				int vref;
+
 				vref = regulator_get_voltage(chip->reg);
 				if (vref < 0)
 					return vref;
drivers/staging/iio/adc/Kconfig +0 -7
index b87e382..75d2d1b 100644
@@ -3,13 +3,6 @@
 #
 menu "Analog to digital converters"
 
-config AD7291
-	tristate "Analog Devices AD7291 ADC driver"
-	depends on I2C
-	help
-	  Say yes here to build support for Analog Devices AD7291
-	  8 Channel ADC with temperature sensor.
-
 config AD7606
 	tristate "Analog Devices AD7606 ADC driver"
 	depends on GPIOLIB
drivers/staging/iio/adc/Makefile +0 -1
index afdcd1f..1c4277d 100644
@@ -8,7 +8,6 @@ ad7606-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
 ad7606-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
 obj-$(CONFIG_AD7606) += ad7606.o
 
-obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7780) += ad7780.o
 obj-$(CONFIG_AD7816) += ad7816.o
 obj-$(CONFIG_AD7192) += ad7192.o
include/linux/platform_data/ad7291.h renamed from drivers/staging/iio/adc/ad7291.h +0 -0
similarity index 100%
rename from drivers/staging/iio/adc/ad7291.h
rename to include/linux/platform_data/ad7291.h

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Applied
#3 lore raw
Quoted 11 lines · Hartmut Knaack
Quoted 8 lines · Hartmut Knaack
Quoted 6 lines · Lars-Peter Clausen

The ad7291 driver is in a reasonable shape. It does not use non-standard API/ABI and there are no major style issues with the driver. So this patch moves it out of staging.

There is one small warning from checkpatch which is also fixed in this patch. The patch also sorts the #include directives in alphabetical order.

So far, I just took a quick peek into the drivers sources and hope to find some more time for a review later this weekend. But one style issue caught my attention, which I would prefer to have fixed before moving out of staging: the double indentations in ad7291_threshold_reg().

I finally found the time to review the driver and found some minor issues. No show stoppers, but things we might want to fix before moving out of staging. I just sent out some fixes, so it might be a good idea to apply them first (they should not touch areas of this patch).

Quoted 1 line
Quoted 1 line

Applied to the togreg branch of iio.git with all but patch 3 from Hartmut's series applied. Thanks to you both for your hard work on this.

I'll push this out as testing as per normal for the autobuilders to play around with it.

Jonathan

Quoted 128 lines
Quoted 127 lines

include/linux/platform_data/ad7291.h

Quoted 122 lines
---
  drivers/iio/adc/Kconfig                                     | 10 ++++++++++
  drivers/iio/adc/Makefile                                    |  1 +
  drivers/{staging => }/iio/adc/ad7291.c                      | 13 +++++++------
  drivers/staging/iio/adc/Kconfig                             |  7 -------
  drivers/staging/iio/adc/Makefile                            |  1 -
  .../iio/adc => include/linux/platform_data}/ad7291.h        |  0
  6 files changed, 18 insertions(+), 14 deletions(-)

rename drivers/{staging => }/iio/adc/ad7291.c (99%)
rename {drivers/staging/iio/adc => include/linux/platform_data}/ad7291.h (100%)

drivers/iio/adc/Kconfig +10 -0
index 20a7073..11b048a 100644
@@ -20,6 +20,16 @@ config AD7266
  	  Say yes here to build support for Analog Devices AD7265 and AD7266
  	  ADCs.
 
+config AD7291
+	tristate "Analog Devices AD7291 ADC driver"
+	depends on I2C
+	help
+	  Say yes here to build support for Analog Devices AD7291
+	  8 Channel ADC with temperature sensor.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ad7291.
+
  config AD7298
  	tristate "Analog Devices AD7298 ADC driver"
  	depends on SPI
drivers/iio/adc/Makefile +1 -0
index 38cf5c3..ad81b51 100644
@@ -5,6 +5,7 @@
  # When adding new entries keep the list in alphabetical order
  obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o
  obj-$(CONFIG_AD7266) += ad7266.o
+obj-$(CONFIG_AD7291) += ad7291.o
  obj-$(CONFIG_AD7298) += ad7298.o
  obj-$(CONFIG_AD7923) += ad7923.o
  obj-$(CONFIG_AD7476) += ad7476.o
drivers/iio/adc/ad7291.c renamed from drivers/staging/iio/adc/ad7291.c +7 -6
similarity index 99%
rename from drivers/staging/iio/adc/ad7291.c
rename to drivers/iio/adc/ad7291.c
index 357cef2..1728e68 100644
@@ -6,22 +6,22 @@
   * Licensed under the GPL-2 or later.
   */
 
-#include <linux/interrupt.h>
  #include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
+#include <linux/err.h>
  #include <linux/i2c.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
  #include <linux/module.h>
  #include <linux/mutex.h>
  #include <linux/regulator/consumer.h>
-#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/sysfs.h>
 
  #include <linux/iio/iio.h>
  #include <linux/iio/sysfs.h>
  #include <linux/iio/events.h>
 
-#include "ad7291.h"
+#include <linux/platform_data/ad7291.h>
 
  /*
   * Simplified handling
@@ -375,6 +375,7 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
  		case IIO_VOLTAGE:
  			if (chip->reg) {
  				int vref;
+
  				vref = regulator_get_voltage(chip->reg);
  				if (vref < 0)
  					return vref;
drivers/staging/iio/adc/Kconfig +0 -7
index b87e382..75d2d1b 100644
@@ -3,13 +3,6 @@
  #
  menu "Analog to digital converters"
 
-config AD7291
-	tristate "Analog Devices AD7291 ADC driver"
-	depends on I2C
-	help
-	  Say yes here to build support for Analog Devices AD7291
-	  8 Channel ADC with temperature sensor.
-
  config AD7606
  	tristate "Analog Devices AD7606 ADC driver"
  	depends on GPIOLIB
drivers/staging/iio/adc/Makefile +0 -1
index afdcd1f..1c4277d 100644
@@ -8,7 +8,6 @@ ad7606-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
  ad7606-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
  obj-$(CONFIG_AD7606) += ad7606.o
 
-obj-$(CONFIG_AD7291) += ad7291.o
  obj-$(CONFIG_AD7780) += ad7780.o
  obj-$(CONFIG_AD7816) += ad7816.o
  obj-$(CONFIG_AD7192) += ad7192.o
include/linux/platform_data/ad7291.h renamed from drivers/staging/iio/adc/ad7291.h +0 -0
similarity index 100%
rename from drivers/staging/iio/adc/ad7291.h
rename to include/linux/platform_data/ad7291.h

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html