Re: randconfig build warnings in staging/iio/meter/

2014-12-15 Thread Daniel Baluta
On Mon, Dec 15, 2014 at 10:25 AM, devendra.aaru  wrote:
> Hello,
>
> With next-20141215, i have got the following build warnings:
>
>
> drivers/staging/iio/meter/ade7754.c:222:6: warning: ‘val’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> drivers/staging/iio/meter/ade7754.c:368:6: warning: ‘val’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> drivers/staging/iio/meter/ade7759.c:224:6: warning: ‘val’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> drivers/staging/iio/meter/ade7759.c:309:6: warning: ‘val’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>
> I have attached the randconfig file.
>
> The possible fix for ade7754.c is to check the return value of
> ade7754_spi_read_reg_8 function at line 222, and at line 368.
>
> The possible fix for ade7759.c is to check the return value of
> ade7759_spi_read_reg_16 function at line 224, and at line 309.

Hi,

Thanks for reporting! We are working on IIO cleanup project [1]
and we can take care of fixing this.

thanks,
Daniel.

[1] http://iiobits.wordpress.com/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: randconfig build warnings in staging/iio/meter/

2014-12-15 Thread Daniel Baluta
On Mon, Dec 15, 2014 at 10:48 AM, devendra.aaru  wrote:
>> Hi,
>>
>> Thanks for reporting! We are working on IIO cleanup project [1]
>> and we can take care of fixing this.
>>
>
> Thanks for a very quick response. I did fix those warnings. Let me
> know if i need to send patches to iio ml.

All right. Send them to Greg (CCed) + linux-iio for review.

thanks,
Daniel.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH] Fixed IIO_DEVICE_ATTR_NAMED API to take name as a string and added "" around names

2017-09-12 Thread Daniel Baluta
Hi Himanshi,

On Tue, Sep 12, 2017 at 1:43 AM, Himanshi Jain  wrote:
> Fixed IIO_DEVICE_ATTR_NAMED API to take name as a
> string instead of implicit conversion to string using
> preprocessors. Added double quotes around names in
> existing usage of IIO_DEVICE_ATTR_NAMED.

Always use imperative mood in commit subject (Fix instead of Fixed).

The subject should contain a tag, which describes the subsytem/files affected.

I would split this patch into:

1) sysfs: iio: Introduce *_ATTR_NAMED

and explain here why do we need  __ATTR_NAMED and IIO_ATTR_NAMED

2) iio: Use new IIO_DEVICE_ATTR_NAMED API

But of course, lets wait to see Lars and Jonathan's opinions.
thanks,
Daniel.

>
> Signed-off-by: Himanshi Jain 
> ---
>  drivers/iio/adc/ad7793.c  | 2 +-
>  drivers/staging/iio/adc/ad7192.c  | 2 +-
>  drivers/staging/iio/adc/ad7280a.c | 4 ++--
>  include/linux/iio/sysfs.h | 6 +-
>  include/linux/sysfs.h | 7 +++
>  5 files changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c
> index e6706a0..d74e324 100644
> --- a/drivers/iio/adc/ad7793.c
> +++ b/drivers/iio/adc/ad7793.c
> @@ -420,7 +420,7 @@ static ssize_t ad7793_show_scale_available(struct device 
> *dev,
>  }
>
>  static IIO_DEVICE_ATTR_NAMED(in_m_in_scale_available,
> -   in_voltage-voltage_scale_available, S_IRUGO,
> +   "in_voltage-voltage_scale_available", S_IRUGO,
> ad7793_show_scale_available, NULL, 0);
>
>  static struct attribute *ad7793_attributes[] = {
> diff --git a/drivers/staging/iio/adc/ad7192.c 
> b/drivers/staging/iio/adc/ad7192.c
> index d11c6de..daff38c 100644
> --- a/drivers/staging/iio/adc/ad7192.c
> +++ b/drivers/staging/iio/adc/ad7192.c
> @@ -341,7 +341,7 @@ static int ad7192_setup(struct ad7192_state *st,
>  }
>
>  static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
> -in_voltage-voltage_scale_available,
> +"in_voltage-voltage_scale_available",
>  0444, ad7192_show_scale_available, NULL, 0);
>
>  static IIO_DEVICE_ATTR(in_voltage_scale_available, 0444,
> diff --git a/drivers/staging/iio/adc/ad7280a.c 
> b/drivers/staging/iio/adc/ad7280a.c
> index f85dde9..fd32e9a 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -750,14 +750,14 @@ static irqreturn_t ad7280_event_handler(int irq, void 
> *private)
>  }
>
>  static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
> -   in_voltage-voltage_thresh_low_value,
> +   "in_voltage-voltage_thresh_low_value",
> 0644,
> ad7280_read_channel_config,
> ad7280_write_channel_config,
> AD7280A_CELL_UNDERVOLTAGE);
>
>  static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
> -   in_voltage-voltage_thresh_high_value,
> +   "in_voltage-voltage_thresh_high_value",
> 0644,
> ad7280_read_channel_config,
> ad7280_write_channel_config,
> diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h
> index ce9426c..49c81a4 100644
> --- a/include/linux/iio/sysfs.h
> +++ b/include/linux/iio/sysfs.h
> @@ -55,6 +55,10 @@ struct iio_const_attr {
> { .dev_attr = __ATTR(_name, _mode, _show, _store),  \
>   .address = _addr }
>
> +#define IIO_ATTR_NAMED(_name, _mode, _show, _store, _addr) \
> +   { .dev_attr = __ATTR_NAMED(_name, _mode, _show, _store),\
> + .address = _addr }
> +
>  #define IIO_ATTR_RO(_name, _addr)   \
> { .dev_attr = __ATTR_RO(_name), \
>   .address = _addr }
> @@ -85,7 +89,7 @@ struct iio_const_attr {
>
>  #define IIO_DEVICE_ATTR_NAMED(_vname, _name, _mode, _show, _store, _addr) \
> struct iio_dev_attr iio_dev_attr_##_vname   \
> -   = IIO_ATTR(_name, _mode, _show, _store, _addr)
> +   = IIO_ATTR_NAMED(_name, _mode, _show, _store, _addr)
>
>  #define IIO_CONST_ATTR(_name, _string) \
> struct iio_const_attr iio_const_attr_##_name\
> diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
> index aa02c32..20321cf 100644
> --- a/include/linux/sysfs.h
> +++ b/include/linux/sysfs.h
> @@ -104,6 +104,13 @@ struct attribute_group {
> .store  = _store,   \
>  }
>
> +#define __ATTR_NAMED(_name, _mode, _show, _store) {\
> +   .attr = {.name = _name, \
> +.mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
> +   .show = _show,  \
> +   .store = _store,\
> +}
> +
>  #define __ATTR_PREALLOC(_name, _mode, _show, _store) { \
> .attr = {.name = __stringify(_name),   

Re: [PATCH 1/2] staging: iio_simple_dummy: fix init

2015-05-26 Thread Daniel Baluta
Hi,

On Wed, May 27, 2015 at 1:19 AM, Vladimirs Ambrosovs
 wrote:
> This patch fixes the init function for the iio_simple_dummy driver.
> The main issues were absence of kfree for the allocated array, and no
> devices being removed in case the probe function fails, running in a loop.
>
> The iio_dummy_remove function was also changed:
> * The return value was changed to void
> * The check for return value of iio_simple_dummy_events_unregister()
> The reason for this changes is that, as per implementation,
> events_unregister function always returns 0, so we are safe not to check
> return value. As a result the return value for iio_dummy_remove function
> becomes useless as well, hence return value type change.

While at it I think we can also make
iio_simple_dummy_events_unregister return type void.
Nice to see that people pay attention to the dummy module :).

As part of Outreachy program, Cristina (CC'ed) will work on making the
IIO dummy driver
more useful with the final goal of moving it out of staging.

http://kernelnewbies.org/OutreachyIntro


>
> Signed-off-by: Vladimirs Ambrosovs 
> ---
>  drivers/staging/iio/iio_simple_dummy.c | 24 +++-
>  1 file changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/iio/iio_simple_dummy.c 
> b/drivers/staging/iio/iio_simple_dummy.c
> index b47bf9f..88fbb4f 100644
> --- a/drivers/staging/iio/iio_simple_dummy.c
> +++ b/drivers/staging/iio/iio_simple_dummy.c
> @@ -665,9 +665,8 @@ error_ret:
>   *
>   * Parameters follow those of iio_dummy_probe for buses.
>   */
> -static int iio_dummy_remove(int index)
> +static void iio_dummy_remove(int index)
>  {
> -   int ret;
> /*
>  * Get a pointer to the device instance iio_dev structure
>  * from the bus subsystem. E.g.
> @@ -685,15 +684,14 @@ static int iio_dummy_remove(int index)
> /* Buffered capture related cleanup */
> iio_simple_dummy_unconfigure_buffer(indio_dev);
>
> -   ret = iio_simple_dummy_events_unregister(indio_dev);
> -   if (ret)
> -   goto error_ret;
> +   /*
> +* Tidy up interrupt handling
> +* Always returns 0, so not checking for return value
> +*/
> +   iio_simple_dummy_events_unregister(indio_dev);
>
> /* Free all structures */
> iio_device_free(indio_dev);
> -
> -error_ret:
> -   return ret;
>  }
>
>  /**
> @@ -722,9 +720,17 @@ static __init int iio_dummy_init(void)
> for (i = 0; i < instances; i++) {
> ret = iio_dummy_probe(i);
> if (ret < 0)
> -   return ret;
> +   goto error_probe;
> }
> return 0;
> +
> +error_probe:
> +   /* Free devices registered before error */
> +   while (i--)
> +   iio_dummy_remove(i);
> +
> +   kfree(iio_dummy_devs);
> +   return ret;
>  }
>  module_init(iio_dummy_init);
>
> --
> 2.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: iio_simple_dummy: fix init

2015-05-27 Thread Daniel Baluta
On Wed, May 27, 2015 at 8:29 PM, Dan Carpenter  wrote:
> On Wed, May 27, 2015 at 08:24:18PM +0300, Vladimirs Ambrosovs wrote:
>> On Wed, May 27, 2015 at 09:21:28AM +0300, Daniel Baluta wrote:
>> > Hi,
>> >
>> > On Wed, May 27, 2015 at 1:19 AM, Vladimirs Ambrosovs
>> >  wrote:
>> > > This patch fixes the init function for the iio_simple_dummy driver.
>> > > The main issues were absence of kfree for the allocated array, and no
>> > > devices being removed in case the probe function fails, running in a 
>> > > loop.
>> > >
>> > > The iio_dummy_remove function was also changed:
>> > > * The return value was changed to void
>> > > * The check for return value of 
>> > > iio_simple_dummy_events_unregister()
>> > > The reason for this changes is that, as per implementation,
>> > > events_unregister function always returns 0, so we are safe not to check
>> > > return value. As a result the return value for iio_dummy_remove function
>> > > becomes useless as well, hence return value type change.
>> >
>> > While at it I think we can also make
>> > iio_simple_dummy_events_unregister return type void.
>> > Nice to see that people pay attention to the dummy module :).
>> >
>> > As part of Outreachy program, Cristina (CC'ed) will work on making the
>> > IIO dummy driver
>> > more useful with the final goal of moving it out of staging.
>> >
>> > http://kernelnewbies.org/OutreachyIntro
>> >
>> >
>> Thanks, that's a good point. Should I re-submit the patch, or better
>> reject the changes, and leave it to Cristina to address in scope of
>> Outreachy project?
>
> No no.  Please resend the patches.

Agree.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [firefly] [PATCH] staging: cxt1e1: hwprobe: Fix sparse warning

2014-03-18 Thread Daniel Baluta
>> Signed-off-by: Matei Oprea 
>> Cc: ROSEdu Kernel Community 
>
> Why the cc: for a non-maintainer / person?

We try to keep track of student's contributions in this way.
Also, patches are internally reviewed on this mailing list before
sending them to maintainers.

thanks,
Daniel.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC PATCH 1/2] iio: hmc5843 Add channel attribute for bias configuration

2016-02-05 Thread Daniel Baluta
On Thu, Feb 4, 2016 at 7:45 PM, Lars-Peter Clausen  wrote:
> On 02/04/2016 03:50 PM, Cristina Moraru wrote:
>> Replace non standard meas_conf attribute with the standard IIO
>> calibbias attribute.
>>
>> API for setting bias measurement configuration:
>>
>> 0 - Normal measurement configuration (default): In normal measurement
>> configuration the device follows normal measurement flow. Pins BP
>> and BN are left floating and high impedance.
>>
>> 1 - Positive bias configuration: In positive bias configuration, a
>> positive current is forced across the resistive load on pins BP
>> and BN.
>>
>> 2 - Negative bias configuration. In negative bias configuration, a
>> negative current is forced across the resistive load on pins BP
>> and BN.
>>
>> 3 - Only available on HMC5983. Magnetic sensor is disabled.
>> Temperature sensor is enabled.
>>
>> With this in place, we can think of moving this driver out of staging.
>
> Using a standard attribute, but overloading it with custom semantics doesn't
> do any good either. calibbias is supposed to be a integer that gets added to
> measurements internally in the device (unit is device specific though).
>
> This attribute seems to do something else. In that case it might be better
> to stay with a custom attribute (as long as it is documented) or come up
> with a better way to map the device configuration onto standard attributes.

We missed the RFC tag. So, with this in mind we still have some minor
issues to fix and then we can move the code out of staging.

1) checkpatch.pl -- strict warnings
2) suspend/resume functions in hmc5843_core.c.

int hmc5843_common_suspend(struct device *dev)
{
return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)),
HMC5843_MODE_CONVERSION_CONTINUOUS);
}

int hmc5843_common_resume(struct device *dev)
{
return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)),
HMC5843_MODE_SLEEP);
}

I think the function names or implementations were swapped.
The device should go to sleep at suspend and back to continuous
mode on resume.

thanks,
Daniel.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 3/3] iio: hmc5843: Move hmc5843 out of staging

2016-02-22 Thread Daniel Baluta
On Sun, Feb 21, 2016 at 10:29 PM, Jonathan Cameron  wrote:
> On 14/02/16 22:37, Cristina Moraru wrote:
>> This patch moves hmc5843 driver from staging/iio/magnetometer
>> to iio/magnetometer, updates the corresponding Makefiles and
>> moves the hmc5843* entries to the 'Industrial I/O support ->
>> Magnetometer sensors' menu.
>>
>> Signed-off-by: Cristina Moraru 
>> Cc: Daniel Baluta 
> For some reason I couldn't immediately identify this patch wouldn't
> apply to my tree. I hand applied it and all seemed fine, but please do
> sanity check the result - shortly to be in the testing branch of iio.git
>
> Applied.  Thanks,
>

Hi,

Most likely is because of this patch:

commit 343af6379e950266ee3d4f638a3ffe0b01b08eab
Author: Bhumika Goyal 
Date:   Fri Feb 12 20:40:29 2016 +0530

Staging: iio: magnetometer: remove exceptional & on function name

In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// 
@r@
identifier f;
@@

f(...) { ... }
@@
identifier r.f;
@@

- &f
+ f
// 

Signed-off-by: Bhumika Goyal 
Signed-off-by: Greg Kroah-Hartman 


This arrived in IIO tree via Greg's staging tree rebase. So, now the
changes done be
Bhumika are reverted.

The simplest solution would be for Bhumika to resend her patch rebased
on linux-iio
tree on testing branch.



> Jonathan
>> ---
>> Changes since v1:
>> No change since v1
>>  drivers/iio/magnetometer/Kconfig|  33 ++
>>  drivers/iio/magnetometer/Makefile   |   4 +
>>  drivers/iio/magnetometer/hmc5843.h  |  65 +++
>>  drivers/iio/magnetometer/hmc5843_core.c | 686 
>> 
>>  drivers/iio/magnetometer/hmc5843_i2c.c  | 103 
>>  drivers/iio/magnetometer/hmc5843_spi.c  | 100 
>>  drivers/staging/iio/magnetometer/Kconfig|  32 --
>>  drivers/staging/iio/magnetometer/Makefile   |   4 +-
>>  drivers/staging/iio/magnetometer/hmc5843.h  |  65 ---
>>  drivers/staging/iio/magnetometer/hmc5843_core.c | 686 
>> 
>>  drivers/staging/iio/magnetometer/hmc5843_i2c.c  | 103 
>>  drivers/staging/iio/magnetometer/hmc5843_spi.c  | 100 
>>  12 files changed, 992 insertions(+), 989 deletions(-)
>>  create mode 100644 drivers/iio/magnetometer/hmc5843.h
>>  create mode 100644 drivers/iio/magnetometer/hmc5843_core.c
>>  create mode 100644 drivers/iio/magnetometer/hmc5843_i2c.c
>>  create mode 100644 drivers/iio/magnetometer/hmc5843_spi.c
>>  delete mode 100644 drivers/staging/iio/magnetometer/hmc5843.h
>>  delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_core.c
>>  delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_i2c.c
>>  delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_spi.c
>>
>> diff --git a/drivers/iio/magnetometer/Kconfig 
>> b/drivers/iio/magnetometer/Kconfig
>> index 868abad..021dc53 100644
>> --- a/drivers/iio/magnetometer/Kconfig
>> +++ b/drivers/iio/magnetometer/Kconfig
>> @@ -105,4 +105,37 @@ config IIO_ST_MAGN_SPI_3AXIS
>>   depends on IIO_ST_MAGN_3AXIS
>>   depends on IIO_ST_SENSORS_SPI
>>
>> +config SENSORS_HMC5843
>> + tristate
>> + select IIO_BUFFER
>> + select IIO_TRIGGERED_BUFFER
>> +
>> +config SENSORS_HMC5843_I2C
>> + tristate "Honeywell HMC5843/5883/5883L 3-Axis Magnetometer (I2C)"
>> + depends on I2C
>> + select SENSORS_HMC5843
>> + select REGMAP_I2C
>> + help
>> +   Say Y here to add support for the Honeywell HMC5843, HMC5883 and
>> +   HMC5883L 3-Axis Magnetometer (digital compass).
>> +
>> +   This driver can also be compiled as a set of modules.
>> +   If so, these modules will be created:
>> +   - hmc5843_core (core functions)
>> +   - hmc5843_i2c (support for HMC5843, HMC5883, HMC5883L and HMC5983)
>> +
>> +config SENSORS_HMC5843_SPI
>> + tristate "Honeywell HMC5983 3-Axis Magnetometer (SPI)"
>> + depends on SPI_MASTER
>> + select SENSORS_HMC5843
>> + select REGMAP_SPI
>> + help
>> +   Say Y here to add support for the Honeywell HMC5983 3-Axis 
>> Magnetometer
>> +   (digital compass).
>> +
>> +   This driver can also be compiled as a set of modules.
>> +   If so, these modules will be created:
>> +   - hmc5843_core (core functions)
>> +   - hmc5843_spi (support for HMC5983)
>> +
>>  endmenu
>> diff --git a/drivers/iio/magnetometer/

Re: [PATCH] staging: iio_simple_dummy: Fix indentation errors

2015-08-05 Thread Daniel Baluta
On Wed, Aug 5, 2015 at 3:15 PM, Lars Svensson
 wrote:
> Fixing indentation errors in
> drivers/staging/iio/iio_simple_dummy_events.c.
>
> Signed-off-by: Lars Svensson 

Good catch.

Acked-by: Daniel Baluta 


> ---
>  drivers/staging/iio/iio_simple_dummy_events.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/iio/iio_simple_dummy_events.c 
> b/drivers/staging/iio/iio_simple_dummy_events.c
> index ecc563c..73108ba 100644
> --- a/drivers/staging/iio/iio_simple_dummy_events.c
> +++ b/drivers/staging/iio/iio_simple_dummy_events.c
> @@ -120,7 +120,7 @@ int iio_simple_dummy_read_event_value(struct iio_dev 
> *indio_dev,
>   const struct iio_chan_spec *chan,
>   enum iio_event_type type,
>   enum iio_event_direction dir,
> - enum iio_event_info info,
> + enum iio_event_info info,
>   int *val, int *val2)
>  {
> struct iio_dummy_state *st = iio_priv(indio_dev);
> @@ -143,7 +143,7 @@ int iio_simple_dummy_write_event_value(struct iio_dev 
> *indio_dev,
>const struct iio_chan_spec *chan,
>enum iio_event_type type,
>enum iio_event_direction dir,
> -  enum iio_event_info info,
> +  enum iio_event_info info,
>int val, int val2)
>  {
> struct iio_dummy_state *st = iio_priv(indio_dev);
> --
> 1.8.2.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: iio: select IRQ_WORK for IIO_DUMMY_EVGEN

2015-10-19 Thread Daniel Baluta
On Sat, Oct 17, 2015 at 1:29 AM, Arnd Bergmann  wrote:
> The iio dummy code was recently changed to use irq_work_queue, but
> that code is compiled into the kernel only if IRQ_WORK is set, so
> we can get a link error here:
>
> drivers/built-in.o: In function `iio_evgen_poke':
> (.text+0x208a04): undefined reference to `irq_work_queue'
>
> This changes the Kconfig file to match what other drivers do.
>
> Signed-off-by: Arnd Bergmann 
> Fixes: fd2bb310ca3d ("Staging: iio: Move evgen interrupt generation to 
> irq_work")

Acked-by: Daniel Baluta 

> ---
> Found on ARM randconfig tests
>
> diff --git a/drivers/staging/iio/Kconfig b/drivers/staging/iio/Kconfig
> index 6d5b38d69578..9d7f0004d2d7 100644
> --- a/drivers/staging/iio/Kconfig
> +++ b/drivers/staging/iio/Kconfig
> @@ -18,7 +18,8 @@ source "drivers/staging/iio/resolver/Kconfig"
>  source "drivers/staging/iio/trigger/Kconfig"
>
>  config IIO_DUMMY_EVGEN
> -   tristate
> +   tristate
> +   select IRQ_WORK
>
>  config IIO_SIMPLE_DUMMY
> tristate "An example driver with no hardware requirements"
>
> --
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: iio: remove duplicate case labels

2014-07-07 Thread Daniel Baluta
Otherwise, compiling iio_event_monitor program fails:

io_event_monitor.c: In function ‘event_is_known’:
iio_event_monitor.c:125:2: error: duplicate case value
  case IIO_MOD_LIGHT_BOTH:
  ^
iio_event_monitor.c:121:2: error: previously used here
  case IIO_MOD_LIGHT_BOTH:

Fixes: da4db94 (iio staging: add recently added modifiers to iio_event_monitor)
Signed-off-by: Daniel Baluta 
---
 drivers/staging/iio/Documentation/iio_event_monitor.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/iio/Documentation/iio_event_monitor.c 
b/drivers/staging/iio/Documentation/iio_event_monitor.c
index cb35a97..569d6f8 100644
--- a/drivers/staging/iio/Documentation/iio_event_monitor.c
+++ b/drivers/staging/iio/Documentation/iio_event_monitor.c
@@ -122,8 +122,6 @@ static bool event_is_known(struct iio_event_data *event)
case IIO_MOD_LIGHT_IR:
case IIO_MOD_ROOT_SUM_SQUARED_X_Y:
case IIO_MOD_SUM_SQUARED_X_Y_Z:
-   case IIO_MOD_LIGHT_BOTH:
-   case IIO_MOD_LIGHT_IR:
case IIO_MOD_LIGHT_CLEAR:
case IIO_MOD_LIGHT_RED:
case IIO_MOD_LIGHT_GREEN:
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: iio/meter: add name to function definition arguments

2018-02-16 Thread Daniel Baluta
Hi Rodrigo,

I think this is a nice finding. One comment inline:

On Vi, 2018-02-16 at 10:50 -0200, rodrigosiqueira wrote:
> This patch fixes the checkpatch.pl warning:
> 
> drivers/staging/iio/meter/ade7854.h:157: WARNING: function definition
> argument 'struct device *' should also have an identifier name...
> 
> + int (*read_reg_32)(struct device *dev, u16 reg_address, u32 *val);
> + int (*write_reg_8)(struct device *dev, u16 reg_address, u8 value);


Any particular reason for using val vs value? I get that one is a pointer
and another a plain type, but I think the name should be the same.

thanks,
Daniel.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel