linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: iio: ad7476: fix !CONFIG_IIO_RING_BUFFER build issue reported by Randy Dunlap
@ 2010-10-14  8:17 michael.hennerich
  2010-10-14 10:22 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: michael.hennerich @ 2010-10-14  8:17 UTC (permalink / raw)
  To: greg
  Cc: linux-iio, drivers, jic23, device-drivers-devel, randy.dunlap,
	devel, sfr, linux-next, Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

Fix function function decalration
Enable CONFIG_IIO_RING_BUFFER for the ad7476 driver

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/staging/iio/adc/Kconfig  |    3 +++
 drivers/staging/iio/adc/ad7476.h |    4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index 81a7d45..acb6767 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -50,6 +50,9 @@ config AD799X_RING_BUFFER
 config AD7476
 	tristate "Analog Devices AD7475/6/7/8 AD7466/7/8 and AD7495 ADC driver"
 	depends on SPI
+	select IIO_RING_BUFFER	
+	select IIO_SW_RING
+	select IIO_TRIGGER 	
 	help
 	  Say yes here to build support for Analog Devices
 	  AD7475, AD7476, AD7477, AD7478, AD7466, AD7467, AD7468, AD7495
diff --git a/drivers/staging/iio/adc/ad7476.h b/drivers/staging/iio/adc/ad7476.h
index 6e4a85b..b51b49e 100644
--- a/drivers/staging/iio/adc/ad7476.h
+++ b/drivers/staging/iio/adc/ad7476.h
@@ -59,9 +59,7 @@ int ad7476_scan_from_ring(struct ad7476_state *st);
 int ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev);
 void ad7476_ring_cleanup(struct iio_dev *indio_dev);
 #else /* CONFIG_IIO_RING_BUFFER */
-static inline ssize_t ad7476_scan_from_ring(struct device *dev,
-					     struct device_attribute *attr,
-					     char *buf)
+static inline int ad7476_scan_from_ring(struct ad7476_state *st)
 {
 	return 0;
 }
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: iio: ad7476: fix !CONFIG_IIO_RING_BUFFER build issue reported by Randy Dunlap
  2010-10-14  8:17 [PATCH] staging: iio: ad7476: fix !CONFIG_IIO_RING_BUFFER build issue reported by Randy Dunlap michael.hennerich
@ 2010-10-14 10:22 ` Jonathan Cameron
  2010-10-14 11:06   ` Hennerich, Michael
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2010-10-14 10:22 UTC (permalink / raw)
  To: michael.hennerich
  Cc: greg, linux-iio, drivers, device-drivers-devel, randy.dunlap,
	devel, sfr, linux-next

On 10/14/10 09:17, michael.hennerich@analog.com wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
> 
> Fix function function decalration
> Enable CONFIG_IIO_RING_BUFFER for the ad7476 driver
> 
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
>  drivers/staging/iio/adc/Kconfig  |    3 +++
>  drivers/staging/iio/adc/ad7476.h |    4 +---
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
> index 81a7d45..acb6767 100644
> --- a/drivers/staging/iio/adc/Kconfig
> +++ b/drivers/staging/iio/adc/Kconfig
> @@ -50,6 +50,9 @@ config AD799X_RING_BUFFER
>  config AD7476
>  	tristate "Analog Devices AD7475/6/7/8 AD7466/7/8 and AD7495 ADC driver"
>  	depends on SPI
> +	select IIO_RING_BUFFER	
> +	select IIO_SW_RING
> +	select IIO_TRIGGER 	
>  	help
>  	  Say yes here to build support for Analog Devices
>  	  AD7475, AD7476, AD7477, AD7478, AD7466, AD7467, AD7468, AD7495
> diff --git a/drivers/staging/iio/adc/ad7476.h b/drivers/staging/iio/adc/ad7476.h
> index 6e4a85b..b51b49e 100644
> --- a/drivers/staging/iio/adc/ad7476.h
> +++ b/drivers/staging/iio/adc/ad7476.h
> @@ -59,9 +59,7 @@ int ad7476_scan_from_ring(struct ad7476_state *st);
>  int ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev);
>  void ad7476_ring_cleanup(struct iio_dev *indio_dev);
>  #else /* CONFIG_IIO_RING_BUFFER */

If you are selecting the ring buffer (which is fine), then why do you need
anything to be in this else?  The buffer will always be there.

Maybe I'm missing something?
> -static inline ssize_t ad7476_scan_from_ring(struct device *dev,
> -					     struct device_attribute *attr,
> -					     char *buf)
> +static inline int ad7476_scan_from_ring(struct ad7476_state *st)
>  {
>  	return 0;
>  }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] staging: iio: ad7476: fix !CONFIG_IIO_RING_BUFFER build issue reported by Randy Dunlap
  2010-10-14 10:22 ` Jonathan Cameron
@ 2010-10-14 11:06   ` Hennerich, Michael
  2010-10-14 11:20     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Hennerich, Michael @ 2010-10-14 11:06 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: greg@kroah.com, linux-iio@vger.kernel.org, Drivers,
	device-drivers-devel@blackfin.uclinux.org,
	randy.dunlap@oracle.com, devel@driverdev.osuosl.org,
	sfr@canb.auug.org.au, linux-next@vger.kernel.org

Jonathan Cameron wrote on 2010-10-14:
> On 10/14/10 09:17, michael.hennerich@analog.com wrote:
>> From: Michael Hennerich <michael.hennerich@analog.com>
>>
>> Fix function function decalration
>> Enable CONFIG_IIO_RING_BUFFER for the ad7476 driver
>>
>> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
>> ---
>>  drivers/staging/iio/adc/Kconfig  |    3 +++
>>  drivers/staging/iio/adc/ad7476.h |    4 +---
>>  2 files changed, 4 insertions(+), 3 deletions(-)
>> diff --git a/drivers/staging/iio/adc/Kconfig
>> b/drivers/staging/iio/adc/Kconfig index 81a7d45..acb6767 100644
>> --- a/drivers/staging/iio/adc/Kconfig
>> +++ b/drivers/staging/iio/adc/Kconfig
>> @@ -50,6 +50,9 @@ config AD799X_RING_BUFFER  config AD7476
>>      tristate "Analog Devices AD7475/6/7/8 AD7466/7/8 and AD7495 ADC
>>  driver"     depends on SPI
>> +    select IIO_RING_BUFFER
>> +    select IIO_SW_RING
>> +    select IIO_TRIGGER
>>      help
>>        Say yes here to build support for Analog Devices
>>        AD7475, AD7476, AD7477, AD7478, AD7466, AD7467, AD7468, AD7495
>> diff --git a/drivers/staging/iio/adc/ad7476.h
>> b/drivers/staging/iio/adc/ad7476.h
>> index 6e4a85b..b51b49e 100644
>> --- a/drivers/staging/iio/adc/ad7476.h
>> +++ b/drivers/staging/iio/adc/ad7476.h
>> @@ -59,9 +59,7 @@ int ad7476_scan_from_ring(struct ad7476_state
>> *st); int ad7476_register_ring_funcs_and_init(struct iio_dev
>> *indio_dev); void ad7476_ring_cleanup(struct iio_dev *indio_dev);
>> #else /* CONFIG_IIO_RING_BUFFER */
>
> If you are selecting the ring buffer (which is fine), then why do you
> need anything to be in this else?  The buffer will always be there.
>
> Maybe I'm missing something?
Selecting the ringbuffer was a straight way to avoid the configuration
dependency build issue.
You're right, this is currently dead code. But I thought I leave it there, until
reorganization of the ringbuffer include file.
Once this is done, I'll revert and make the ringbuffer optional again.
>> -static inline ssize_t ad7476_scan_from_ring(struct device *dev,
>> -                                         struct device_attribute *attr,
>> -                                         char *buf)
>> +static inline int ad7476_scan_from_ring(struct ad7476_state *st)
>>  {
>>      return 0;
>>  }

Greetings,
Michael

Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 4036 Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: iio: ad7476: fix !CONFIG_IIO_RING_BUFFER build issue reported by Randy Dunlap
  2010-10-14 11:06   ` Hennerich, Michael
@ 2010-10-14 11:20     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2010-10-14 11:20 UTC (permalink / raw)
  To: Hennerich, Michael
  Cc: greg@kroah.com, linux-iio@vger.kernel.org, Drivers,
	device-drivers-devel@blackfin.uclinux.org,
	randy.dunlap@oracle.com, devel@driverdev.osuosl.org,
	sfr@canb.auug.org.au, linux-next@vger.kernel.org

On 10/14/10 12:06, Hennerich, Michael wrote:
> Jonathan Cameron wrote on 2010-10-14:
>> On 10/14/10 09:17, michael.hennerich@analog.com wrote:
>>> From: Michael Hennerich <michael.hennerich@analog.com>
>>>
>>> Fix function function decalration
>>> Enable CONFIG_IIO_RING_BUFFER for the ad7476 driver
>>>
>>> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
>>> ---
>>>  drivers/staging/iio/adc/Kconfig  |    3 +++
>>>  drivers/staging/iio/adc/ad7476.h |    4 +---
>>>  2 files changed, 4 insertions(+), 3 deletions(-)
>>> diff --git a/drivers/staging/iio/adc/Kconfig
>>> b/drivers/staging/iio/adc/Kconfig index 81a7d45..acb6767 100644
>>> --- a/drivers/staging/iio/adc/Kconfig
>>> +++ b/drivers/staging/iio/adc/Kconfig
>>> @@ -50,6 +50,9 @@ config AD799X_RING_BUFFER  config AD7476
>>>      tristate "Analog Devices AD7475/6/7/8 AD7466/7/8 and AD7495 ADC
>>>  driver"     depends on SPI
>>> +    select IIO_RING_BUFFER
>>> +    select IIO_SW_RING
>>> +    select IIO_TRIGGER
>>>      help
>>>        Say yes here to build support for Analog Devices
>>>        AD7475, AD7476, AD7477, AD7478, AD7466, AD7467, AD7468, AD7495
>>> diff --git a/drivers/staging/iio/adc/ad7476.h
>>> b/drivers/staging/iio/adc/ad7476.h
>>> index 6e4a85b..b51b49e 100644
>>> --- a/drivers/staging/iio/adc/ad7476.h
>>> +++ b/drivers/staging/iio/adc/ad7476.h
>>> @@ -59,9 +59,7 @@ int ad7476_scan_from_ring(struct ad7476_state
>>> *st); int ad7476_register_ring_funcs_and_init(struct iio_dev
>>> *indio_dev); void ad7476_ring_cleanup(struct iio_dev *indio_dev);
>>> #else /* CONFIG_IIO_RING_BUFFER */
>>
>> If you are selecting the ring buffer (which is fine), then why do you
>> need anything to be in this else?  The buffer will always be there.
>>
>> Maybe I'm missing something?
> Selecting the ringbuffer was a straight way to avoid the configuration
> dependency build issue.
> You're right, this is currently dead code. But I thought I leave it there, until
> reorganization of the ringbuffer include file.
> Once this is done, I'll revert and make the ringbuffer optional again.
Sensible argument, so I'm happy.

>>> -static inline ssize_t ad7476_scan_from_ring(struct device *dev,
>>> -                                         struct device_attribute *attr,
>>> -                                         char *buf)
>>> +static inline int ad7476_scan_from_ring(struct ad7476_state *st)
>>>  {
>>>      return 0;
>>>  }
> 
> Greetings,
> Michael
> 
> Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
> Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 4036 Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
> 
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-14 11:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-14  8:17 [PATCH] staging: iio: ad7476: fix !CONFIG_IIO_RING_BUFFER build issue reported by Randy Dunlap michael.hennerich
2010-10-14 10:22 ` Jonathan Cameron
2010-10-14 11:06   ` Hennerich, Michael
2010-10-14 11:20     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).