]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
staging: iio: light: treat build warnings as error
authorSri Krishna chowdary <schowdary@nvidia.com>
Fri, 10 Jan 2014 06:01:52 +0000 (11:31 +0530)
committerSachin Nikam <snikam@nvidia.com>
Mon, 13 Jan 2014 10:52:24 +0000 (02:52 -0800)
- 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 153af741278adf38c36b307f98db858e7503e3d3..90114e55a2f437908512583a5abff0621a3c3f1a 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 a26463e6beb9a3939a67450a16f0b8e001099c6d..68e527a32ec5e5453077e7c9ba1f10f7629db114 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 616cdbc3fad89e22682ca783ddaad3fd1f9e853e..9148584c7261491e9b85111051e362a0d5d7910c 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,
        },
 };