staging: iio: light: treat build warnings as error
Sri Krishna chowdary [Fri, 10 Jan 2014 06:01:52 +0000 (11:01 +0530)]
- Makefile: enable Werror flag to treat compile time warnings as errors
- max44005: fix unchecked return value in set_led_drive_strength
- tcs3772: IIO_CHAN_INFO_RAW_SEPERATE_BIT is not defined on 3.10.
  Replace it with IIO_CHAN_INFO_RAW instead.

Bug 1211919

Change-Id: I2036ff9c8f0bad1b67e0c3037678a0e2b5bf0482
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/354070
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

drivers/staging/iio/light/Makefile
drivers/staging/iio/light/max44005.c
drivers/staging/iio/light/tcs3772.c

index 153af74..90114e5 100644 (file)
@@ -3,7 +3,7 @@
 #
 GCOV_PROFILE := y
 
-#ccflags-y := -Werror
+ccflags-y := -Werror
 
 obj-$(CONFIG_SENSORS_CM3218)   += cm3218.o
 obj-$(CONFIG_SENSORS_ISL29018) += isl29018.o
index a26463e..68e527a 100644 (file)
@@ -4,7 +4,7 @@
  * IIO Light driver for monitoring ambient light intensity in lux and proximity
  * ir.
  *
- * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013 - 2014, NVIDIA CORPORATION. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -189,14 +189,21 @@ static bool set_main_conf(struct max44005_chip *chip, int mode)
 /* current is in mA */
 static bool set_led_drive_strength(struct max44005_chip *chip, int cur)
 {
+       int ret = 0;
        if (!chip->supply[LED])
                goto finish;
 
        if (cur && !chip->power_utilization[LED])
-               regulator_enable(chip->supply[LED]);
+               ret = regulator_enable(chip->supply[LED]);
        else if (!cur && chip->power_utilization[LED])
-               regulator_disable(chip->supply[LED]);
+               ret = regulator_disable(chip->supply[LED]);
 
+       if (ret) {
+               dev_err(&chip->client->dev,
+                       "%s: regulator %s failed\n", __func__,
+                       cur ? "enable" : "disable");
+               return false;
+       }
 finish:
        chip->power_utilization[LED] = cur ? 1 : 0;
        return max44005_write(chip, 0xA1, PROX_CONF_REG_ADDR) == 0;
index 616cdbc..9148584 100644 (file)
@@ -4,7 +4,7 @@
  * IIO Light driver for monitoring ambient light intensity in lux and proximity
  * ir.
  *
- * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013 - 2014, NVIDIA CORPORATION. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -392,12 +392,12 @@ static const struct iio_chan_spec_ext_info tcs3772_ext_info[] = {
 static const struct iio_chan_spec tcs3772_channels[] = {
        {
                .type = IIO_LIGHT,
-               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
+               .info_mask_separate = IIO_CHAN_INFO_RAW,
                .ext_info = tcs3772_ext_info,
        },
        {
                .type = IIO_PROXIMITY,
-               .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
+               .info_mask_separate = IIO_CHAN_INFO_RAW,
                .ext_info = tcs3772_ext_info,
        },
 };