diff mbox series

power: supply: remove unneeded include of linux/leds.h

Message ID 20230212-include-power_supply-leds-v1-1-7adbf7424002@weissschuh.net (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series power: supply: remove unneeded include of linux/leds.h | expand

Commit Message

Thomas Weißschuh April 30, 2023, 6:11 a.m. UTC
Instead of including the full linux/leds.h header file a single
forward-declaration is enough.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Currently power_supply.h includes leds.h to get access to
struct led_trigger.
This propagates the inclusion unnecessarily to all users of
power_supply.h.

Replace this inclusion by a single forward declaration.
---
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 include/linux/power_supply.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


---
base-commit: 825a0714d2b3883d4f8ff64f6933fb73ee3f1834
change-id: 20230212-include-power_supply-leds-fe1d71c7b7b2

Best regards,

Comments

kernel test robot April 30, 2023, 7:06 a.m. UTC | #1
Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 825a0714d2b3883d4f8ff64f6933fb73ee3f1834]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/power-supply-remove-unneeded-include-of-linux-leds-h/20230430-141232
base:   825a0714d2b3883d4f8ff64f6933fb73ee3f1834
patch link:    https://lore.kernel.org/r/20230212-include-power_supply-leds-v1-1-7adbf7424002%40weissschuh.net
patch subject: [PATCH] power: supply: remove unneeded include of linux/leds.h
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20230430/202304301500.Ep5XviHQ-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/b75095fc2fd15bc4d539656b12200b44a9705959
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Thomas-Wei-schuh/power-supply-remove-unneeded-include-of-linux-leds-h/20230430-141232
        git checkout b75095fc2fd15bc4d539656b12200b44a9705959
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 olddefconfig
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/hid/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304301500.Ep5XviHQ-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/hid/hid-lg4ff.c:1121:30: warning: 'enum led_brightness' declared inside parameter list will not be visible outside of this definition or declaration
    1121 |                         enum led_brightness value)
         |                              ^~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c:1121:45: error: parameter 2 ('value') has incomplete type
    1121 |                         enum led_brightness value)
         |                         ~~~~~~~~~~~~~~~~~~~~^~~~~
   drivers/hid/hid-lg4ff.c:1120:13: error: function declaration isn't a prototype [-Werror=strict-prototypes]
    1120 | static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c: In function 'lg4ff_led_set_brightness':
   drivers/hid/hid-lg4ff.c:1123:38: error: invalid use of undefined type 'struct led_classdev'
    1123 |         struct device *dev = led_cdev->dev->parent;
         |                                      ^~
   drivers/hid/hid-lg4ff.c:1145:30: error: 'LED_OFF' undeclared (first use in this function)
    1145 |                 if (value == LED_OFF && state) {
         |                              ^~~~~~~
   drivers/hid/hid-lg4ff.c:1145:30: note: each undeclared identifier is reported only once for each function it appears in
   drivers/hid/hid-lg4ff.c: At top level:
   drivers/hid/hid-lg4ff.c:1156:28: error: return type is an incomplete type
    1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c: In function 'lg4ff_led_get_brightness':
   drivers/hid/hid-lg4ff.c:1158:38: error: invalid use of undefined type 'struct led_classdev'
    1158 |         struct device *dev = led_cdev->dev->parent;
         |                                      ^~
   drivers/hid/hid-lg4ff.c:1166:24: error: 'LED_OFF' undeclared (first use in this function)
    1166 |                 return LED_OFF;
         |                        ^~~~~~~
   drivers/hid/hid-lg4ff.c:1166:24: error: 'return' with a value, in function returning void [-Werror=return-type]
   drivers/hid/hid-lg4ff.c:1156:28: note: declared here
    1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c:1173:24: error: 'return' with a value, in function returning void [-Werror=return-type]
    1173 |                 return LED_OFF;
         |                        ^~~~~~~
   drivers/hid/hid-lg4ff.c:1156:28: note: declared here
    1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c:1182:24: error: 'LED_FULL' undeclared (first use in this function); did you mean 'LED_NUML'?
    1182 |         return value ? LED_FULL : LED_OFF;
         |                        ^~~~~~~~
         |                        LED_NUML
   drivers/hid/hid-lg4ff.c:1182:16: error: 'return' with a value, in function returning void [-Werror=return-type]
    1182 |         return value ? LED_FULL : LED_OFF;
         |                ^~~~~
   drivers/hid/hid-lg4ff.c:1156:28: note: declared here
    1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c: In function 'lg4ff_init':
   drivers/hid/hid-lg4ff.c:1410:46: error: invalid application of 'sizeof' to incomplete type 'struct led_classdev'
    1410 |                         led = kzalloc(sizeof(struct led_classdev)+name_sz, GFP_KERNEL);
         |                                              ^~~~~~
   drivers/hid/hid-lg4ff.c:1416:45: error: invalid use of undefined type 'struct led_classdev'
    1416 |                         name = (void *)(&led[1]);
         |                                             ^
   drivers/hid/hid-lg4ff.c:1418:28: error: invalid use of undefined type 'struct led_classdev'
    1418 |                         led->name = name;
         |                            ^~
   drivers/hid/hid-lg4ff.c:1419:28: error: invalid use of undefined type 'struct led_classdev'
    1419 |                         led->brightness = 0;
         |                            ^~
   drivers/hid/hid-lg4ff.c:1420:28: error: invalid use of undefined type 'struct led_classdev'
    1420 |                         led->max_brightness = 1;
         |                            ^~
   drivers/hid/hid-lg4ff.c:1421:28: error: invalid use of undefined type 'struct led_classdev'
    1421 |                         led->brightness_get = lg4ff_led_get_brightness;
         |                            ^~
   drivers/hid/hid-lg4ff.c:1422:28: error: invalid use of undefined type 'struct led_classdev'
    1422 |                         led->brightness_set = lg4ff_led_set_brightness;
         |                            ^~
   drivers/hid/hid-lg4ff.c:1425:33: error: implicit declaration of function 'led_classdev_register'; did you mean 'class_register'? [-Werror=implicit-function-declaration]
    1425 |                         error = led_classdev_register(&hid->dev, led);
         |                                 ^~~~~~~~~~~~~~~~~~~~~
         |                                 class_register
   drivers/hid/hid-lg4ff.c:1436:41: error: implicit declaration of function 'led_classdev_unregister'; did you mean 'class_unregister'? [-Werror=implicit-function-declaration]
    1436 |                                         led_classdev_unregister(led);
         |                                         ^~~~~~~~~~~~~~~~~~~~~~~
         |                                         class_unregister
   cc1: some warnings being treated as errors


vim +1121 drivers/hid/hid-lg4ff.c

22bcefdc883818 Simon Wood   2012-04-21  1119  
22bcefdc883818 Simon Wood   2012-04-21  1120  static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
22bcefdc883818 Simon Wood   2012-04-21 @1121  			enum led_brightness value)
22bcefdc883818 Simon Wood   2012-04-21  1122  {
22bcefdc883818 Simon Wood   2012-04-21  1123  	struct device *dev = led_cdev->dev->parent;
ee79a8f840a45d Geliang Tang 2015-12-27  1124  	struct hid_device *hid = to_hid_device(dev);
4629fd160f7da9 Axel Lin     2012-09-13  1125  	struct lg_drv_data *drv_data = hid_get_drvdata(hid);
22bcefdc883818 Simon Wood   2012-04-21  1126  	struct lg4ff_device_entry *entry;
22bcefdc883818 Simon Wood   2012-04-21  1127  	int i, state = 0;
22bcefdc883818 Simon Wood   2012-04-21  1128  
22bcefdc883818 Simon Wood   2012-04-21  1129  	if (!drv_data) {
22bcefdc883818 Simon Wood   2012-04-21  1130  		hid_err(hid, "Device data not found.");
22bcefdc883818 Simon Wood   2012-04-21  1131  		return;
22bcefdc883818 Simon Wood   2012-04-21  1132  	}
22bcefdc883818 Simon Wood   2012-04-21  1133  
371a1d9e1fed7d Michal Malý  2015-04-08  1134  	entry = drv_data->device_props;
22bcefdc883818 Simon Wood   2012-04-21  1135  
22bcefdc883818 Simon Wood   2012-04-21  1136  	if (!entry) {
22bcefdc883818 Simon Wood   2012-04-21  1137  		hid_err(hid, "Device properties not found.");
22bcefdc883818 Simon Wood   2012-04-21  1138  		return;
22bcefdc883818 Simon Wood   2012-04-21  1139  	}
22bcefdc883818 Simon Wood   2012-04-21  1140  
22bcefdc883818 Simon Wood   2012-04-21  1141  	for (i = 0; i < 5; i++) {
72529c65a5399b Michal Malý  2015-04-08  1142  		if (led_cdev != entry->wdata.led[i])
22bcefdc883818 Simon Wood   2012-04-21  1143  			continue;
72529c65a5399b Michal Malý  2015-04-08  1144  		state = (entry->wdata.led_state >> i) & 1;
22bcefdc883818 Simon Wood   2012-04-21  1145  		if (value == LED_OFF && state) {
72529c65a5399b Michal Malý  2015-04-08  1146  			entry->wdata.led_state &= ~(1 << i);
72529c65a5399b Michal Malý  2015-04-08  1147  			lg4ff_set_leds(hid, entry->wdata.led_state);
22bcefdc883818 Simon Wood   2012-04-21  1148  		} else if (value != LED_OFF && !state) {
72529c65a5399b Michal Malý  2015-04-08  1149  			entry->wdata.led_state |= 1 << i;
72529c65a5399b Michal Malý  2015-04-08  1150  			lg4ff_set_leds(hid, entry->wdata.led_state);
22bcefdc883818 Simon Wood   2012-04-21  1151  		}
22bcefdc883818 Simon Wood   2012-04-21  1152  		break;
22bcefdc883818 Simon Wood   2012-04-21  1153  	}
22bcefdc883818 Simon Wood   2012-04-21  1154  }
22bcefdc883818 Simon Wood   2012-04-21  1155
kernel test robot April 30, 2023, 7:58 a.m. UTC | #2
Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on 825a0714d2b3883d4f8ff64f6933fb73ee3f1834]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/power-supply-remove-unneeded-include-of-linux-leds-h/20230430-141232
base:   825a0714d2b3883d4f8ff64f6933fb73ee3f1834
patch link:    https://lore.kernel.org/r/20230212-include-power_supply-leds-v1-1-7adbf7424002%40weissschuh.net
patch subject: [PATCH] power: supply: remove unneeded include of linux/leds.h
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20230430/202304301551.baBXvI9d-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/b75095fc2fd15bc4d539656b12200b44a9705959
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Thomas-Wei-schuh/power-supply-remove-unneeded-include-of-linux-leds-h/20230430-141232
        git checkout b75095fc2fd15bc4d539656b12200b44a9705959
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 olddefconfig
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304301551.baBXvI9d-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/hid/hid-lg4ff.c:1121:30: warning: 'enum led_brightness' declared inside parameter list will not be visible outside of this definition or declaration
    1121 |                         enum led_brightness value)
         |                              ^~~~~~~~~~~~~~
>> drivers/hid/hid-lg4ff.c:1121:45: error: parameter 2 ('value') has incomplete type
    1121 |                         enum led_brightness value)
         |                         ~~~~~~~~~~~~~~~~~~~~^~~~~
>> drivers/hid/hid-lg4ff.c:1120:13: error: function declaration isn't a prototype [-Werror=strict-prototypes]
    1120 | static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c: In function 'lg4ff_led_set_brightness':
>> drivers/hid/hid-lg4ff.c:1123:38: error: invalid use of undefined type 'struct led_classdev'
    1123 |         struct device *dev = led_cdev->dev->parent;
         |                                      ^~
>> drivers/hid/hid-lg4ff.c:1145:30: error: 'LED_OFF' undeclared (first use in this function)
    1145 |                 if (value == LED_OFF && state) {
         |                              ^~~~~~~
   drivers/hid/hid-lg4ff.c:1145:30: note: each undeclared identifier is reported only once for each function it appears in
   drivers/hid/hid-lg4ff.c: At top level:
>> drivers/hid/hid-lg4ff.c:1156:28: error: return type is an incomplete type
    1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c: In function 'lg4ff_led_get_brightness':
   drivers/hid/hid-lg4ff.c:1158:38: error: invalid use of undefined type 'struct led_classdev'
    1158 |         struct device *dev = led_cdev->dev->parent;
         |                                      ^~
   drivers/hid/hid-lg4ff.c:1166:24: error: 'LED_OFF' undeclared (first use in this function)
    1166 |                 return LED_OFF;
         |                        ^~~~~~~
   drivers/hid/hid-lg4ff.c:1166:24: error: 'return' with a value, in function returning void [-Werror=return-type]
   drivers/hid/hid-lg4ff.c:1156:28: note: declared here
    1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c:1173:24: error: 'return' with a value, in function returning void [-Werror=return-type]
    1173 |                 return LED_OFF;
         |                        ^~~~~~~
   drivers/hid/hid-lg4ff.c:1156:28: note: declared here
    1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/hid/hid-lg4ff.c:1182:24: error: 'LED_FULL' undeclared (first use in this function); did you mean 'LED_NUML'?
    1182 |         return value ? LED_FULL : LED_OFF;
         |                        ^~~~~~~~
         |                        LED_NUML
   drivers/hid/hid-lg4ff.c:1182:16: error: 'return' with a value, in function returning void [-Werror=return-type]
    1182 |         return value ? LED_FULL : LED_OFF;
         |                ^~~~~
   drivers/hid/hid-lg4ff.c:1156:28: note: declared here
    1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-lg4ff.c: In function 'lg4ff_init':
>> drivers/hid/hid-lg4ff.c:1410:46: error: invalid application of 'sizeof' to incomplete type 'struct led_classdev'
    1410 |                         led = kzalloc(sizeof(struct led_classdev)+name_sz, GFP_KERNEL);
         |                                              ^~~~~~
   drivers/hid/hid-lg4ff.c:1416:45: error: invalid use of undefined type 'struct led_classdev'
    1416 |                         name = (void *)(&led[1]);
         |                                             ^
   drivers/hid/hid-lg4ff.c:1418:28: error: invalid use of undefined type 'struct led_classdev'
    1418 |                         led->name = name;
         |                            ^~
   drivers/hid/hid-lg4ff.c:1419:28: error: invalid use of undefined type 'struct led_classdev'
    1419 |                         led->brightness = 0;
         |                            ^~
   drivers/hid/hid-lg4ff.c:1420:28: error: invalid use of undefined type 'struct led_classdev'
    1420 |                         led->max_brightness = 1;
         |                            ^~
   drivers/hid/hid-lg4ff.c:1421:28: error: invalid use of undefined type 'struct led_classdev'
    1421 |                         led->brightness_get = lg4ff_led_get_brightness;
         |                            ^~
   drivers/hid/hid-lg4ff.c:1422:28: error: invalid use of undefined type 'struct led_classdev'
    1422 |                         led->brightness_set = lg4ff_led_set_brightness;
         |                            ^~
>> drivers/hid/hid-lg4ff.c:1425:33: error: implicit declaration of function 'led_classdev_register'; did you mean 'class_register'? [-Werror=implicit-function-declaration]
    1425 |                         error = led_classdev_register(&hid->dev, led);
         |                                 ^~~~~~~~~~~~~~~~~~~~~
         |                                 class_register
>> drivers/hid/hid-lg4ff.c:1436:41: error: implicit declaration of function 'led_classdev_unregister'; did you mean 'class_unregister'? [-Werror=implicit-function-declaration]
    1436 |                                         led_classdev_unregister(led);
         |                                         ^~~~~~~~~~~~~~~~~~~~~~~
         |                                         class_unregister
   cc1: some warnings being treated as errors


vim +1121 drivers/hid/hid-lg4ff.c

22bcefdc8838186 Simon Wood   2012-04-21  1119  
22bcefdc8838186 Simon Wood   2012-04-21 @1120  static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
22bcefdc8838186 Simon Wood   2012-04-21 @1121  			enum led_brightness value)
22bcefdc8838186 Simon Wood   2012-04-21  1122  {
22bcefdc8838186 Simon Wood   2012-04-21 @1123  	struct device *dev = led_cdev->dev->parent;
ee79a8f840a45d3 Geliang Tang 2015-12-27  1124  	struct hid_device *hid = to_hid_device(dev);
4629fd160f7da96 Axel Lin     2012-09-13  1125  	struct lg_drv_data *drv_data = hid_get_drvdata(hid);
22bcefdc8838186 Simon Wood   2012-04-21  1126  	struct lg4ff_device_entry *entry;
22bcefdc8838186 Simon Wood   2012-04-21  1127  	int i, state = 0;
22bcefdc8838186 Simon Wood   2012-04-21  1128  
22bcefdc8838186 Simon Wood   2012-04-21  1129  	if (!drv_data) {
22bcefdc8838186 Simon Wood   2012-04-21  1130  		hid_err(hid, "Device data not found.");
22bcefdc8838186 Simon Wood   2012-04-21  1131  		return;
22bcefdc8838186 Simon Wood   2012-04-21  1132  	}
22bcefdc8838186 Simon Wood   2012-04-21  1133  
371a1d9e1fed7dc Michal Malý  2015-04-08  1134  	entry = drv_data->device_props;
22bcefdc8838186 Simon Wood   2012-04-21  1135  
22bcefdc8838186 Simon Wood   2012-04-21  1136  	if (!entry) {
22bcefdc8838186 Simon Wood   2012-04-21  1137  		hid_err(hid, "Device properties not found.");
22bcefdc8838186 Simon Wood   2012-04-21  1138  		return;
22bcefdc8838186 Simon Wood   2012-04-21  1139  	}
22bcefdc8838186 Simon Wood   2012-04-21  1140  
22bcefdc8838186 Simon Wood   2012-04-21  1141  	for (i = 0; i < 5; i++) {
72529c65a5399be Michal Malý  2015-04-08  1142  		if (led_cdev != entry->wdata.led[i])
22bcefdc8838186 Simon Wood   2012-04-21  1143  			continue;
72529c65a5399be Michal Malý  2015-04-08  1144  		state = (entry->wdata.led_state >> i) & 1;
22bcefdc8838186 Simon Wood   2012-04-21 @1145  		if (value == LED_OFF && state) {
72529c65a5399be Michal Malý  2015-04-08  1146  			entry->wdata.led_state &= ~(1 << i);
72529c65a5399be Michal Malý  2015-04-08  1147  			lg4ff_set_leds(hid, entry->wdata.led_state);
22bcefdc8838186 Simon Wood   2012-04-21  1148  		} else if (value != LED_OFF && !state) {
72529c65a5399be Michal Malý  2015-04-08  1149  			entry->wdata.led_state |= 1 << i;
72529c65a5399be Michal Malý  2015-04-08  1150  			lg4ff_set_leds(hid, entry->wdata.led_state);
22bcefdc8838186 Simon Wood   2012-04-21  1151  		}
22bcefdc8838186 Simon Wood   2012-04-21  1152  		break;
22bcefdc8838186 Simon Wood   2012-04-21  1153  	}
22bcefdc8838186 Simon Wood   2012-04-21  1154  }
22bcefdc8838186 Simon Wood   2012-04-21  1155  
22bcefdc8838186 Simon Wood   2012-04-21 @1156  static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
22bcefdc8838186 Simon Wood   2012-04-21  1157  {
22bcefdc8838186 Simon Wood   2012-04-21  1158  	struct device *dev = led_cdev->dev->parent;
ee79a8f840a45d3 Geliang Tang 2015-12-27  1159  	struct hid_device *hid = to_hid_device(dev);
4629fd160f7da96 Axel Lin     2012-09-13  1160  	struct lg_drv_data *drv_data = hid_get_drvdata(hid);
22bcefdc8838186 Simon Wood   2012-04-21  1161  	struct lg4ff_device_entry *entry;
22bcefdc8838186 Simon Wood   2012-04-21  1162  	int i, value = 0;
22bcefdc8838186 Simon Wood   2012-04-21  1163  
22bcefdc8838186 Simon Wood   2012-04-21  1164  	if (!drv_data) {
22bcefdc8838186 Simon Wood   2012-04-21  1165  		hid_err(hid, "Device data not found.");
22bcefdc8838186 Simon Wood   2012-04-21  1166  		return LED_OFF;
22bcefdc8838186 Simon Wood   2012-04-21  1167  	}
22bcefdc8838186 Simon Wood   2012-04-21  1168  
371a1d9e1fed7dc Michal Malý  2015-04-08  1169  	entry = drv_data->device_props;
22bcefdc8838186 Simon Wood   2012-04-21  1170  
22bcefdc8838186 Simon Wood   2012-04-21  1171  	if (!entry) {
22bcefdc8838186 Simon Wood   2012-04-21  1172  		hid_err(hid, "Device properties not found.");
22bcefdc8838186 Simon Wood   2012-04-21  1173  		return LED_OFF;
22bcefdc8838186 Simon Wood   2012-04-21  1174  	}
22bcefdc8838186 Simon Wood   2012-04-21  1175  
22bcefdc8838186 Simon Wood   2012-04-21  1176  	for (i = 0; i < 5; i++)
72529c65a5399be Michal Malý  2015-04-08  1177  		if (led_cdev == entry->wdata.led[i]) {
72529c65a5399be Michal Malý  2015-04-08  1178  			value = (entry->wdata.led_state >> i) & 1;
22bcefdc8838186 Simon Wood   2012-04-21  1179  			break;
22bcefdc8838186 Simon Wood   2012-04-21  1180  		}
22bcefdc8838186 Simon Wood   2012-04-21  1181  
22bcefdc8838186 Simon Wood   2012-04-21 @1182  	return value ? LED_FULL : LED_OFF;
22bcefdc8838186 Simon Wood   2012-04-21  1183  }
22bcefdc8838186 Simon Wood   2012-04-21  1184  #endif
22bcefdc8838186 Simon Wood   2012-04-21  1185
diff mbox series

Patch

diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index a427f13c757f..dc5e17e8c919 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -14,10 +14,11 @@ 
 
 #include <linux/device.h>
 #include <linux/workqueue.h>
-#include <linux/leds.h>
 #include <linux/spinlock.h>
 #include <linux/notifier.h>
 
+struct led_trigger;
+
 /*
  * All voltages, currents, charges, energies, time and temperatures in uV,
  * µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise