summaryrefslogtreecommitdiff
path: root/include/linux/led-class-flash.h
diff options
context:
space:
mode:
authorJacek Anaszewski <j.anaszewski@samsung.com>2015-03-12 18:45:02 +0300
committerBryan Wu <cooloney@gmail.com>2015-03-30 21:55:48 +0300
commit9647507aff4d885d98a884a634d360b8f2d24c10 (patch)
tree49f854c5ffb53e8bebeabc46b8cc10a199440206 /include/linux/led-class-flash.h
parentf6ad395bad57dcd15c6423715d15d91363a62ae8 (diff)
downloadlinux-9647507aff4d885d98a884a634d360b8f2d24c10.tar.xz
leds: flash: Fix the size of sysfs_groups array
LED_FLASH_MAX_SYSFS_GROUPS macro had value that was relevant for previous version of the patches introducing LED Flash class. Currently it is required to reserve the room for maximum 4 sysfs groups. Since the last element of the struct attribute_group array passed to the function device_create_with_groups has to be NULL, the size of the array has to be greater by one than maximum allowed number of groups. Therefore, the name of the macro is being changed to LED_FLASH_SYSFS_GROUPS_SIZE, to make it more accurrate. Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Bryan Wu <cooloney@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'include/linux/led-class-flash.h')
-rw-r--r--include/linux/led-class-flash.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h
index 21ec91e13c47..e97966d1fb8d 100644
--- a/include/linux/led-class-flash.h
+++ b/include/linux/led-class-flash.h
@@ -32,7 +32,7 @@ struct led_classdev_flash;
#define LED_FAULT_LED_OVER_TEMPERATURE (1 << 8)
#define LED_NUM_FLASH_FAULTS 9
-#define LED_FLASH_MAX_SYSFS_GROUPS 7
+#define LED_FLASH_SYSFS_GROUPS_SIZE 5
struct led_flash_ops {
/* set flash brightness */
@@ -80,7 +80,7 @@ struct led_classdev_flash {
struct led_flash_setting timeout;
/* LED Flash class sysfs groups */
- const struct attribute_group *sysfs_groups[LED_FLASH_MAX_SYSFS_GROUPS];
+ const struct attribute_group *sysfs_groups[LED_FLASH_SYSFS_GROUPS_SIZE];
};
static inline struct led_classdev_flash *lcdev_to_flcdev(