From 1ce4d04425c8f1b48382e054a2b5fd4fc3370e5e Mon Sep 17 00:00:00 2001 From: Richard Sailer Date: Fri, 31 May 2019 21:53:12 +0200 Subject: [PATCH] Move sysfs attribute file managment from .h to .c It's specific to our compilation unit, nothing to export --- src/tuxedo_keyboard.c | 12 ++++++++++++ src/tuxedo_keyboard.h | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/tuxedo_keyboard.c b/src/tuxedo_keyboard.c index 8297d88..0dfd9ad 100644 --- a/src/tuxedo_keyboard.c +++ b/src/tuxedo_keyboard.c @@ -200,6 +200,18 @@ static ssize_t set_mode_fs(struct device *child, struct device_attribute *attr, // Sysfs Interface for if the keyboard has extra region static ssize_t show_hasextra_fs(struct device *child, struct device_attribute *attr, char *buffer); + +// Sysfs device Attributes +static DEVICE_ATTR(state, 0644, show_state_fs, set_state_fs); +static DEVICE_ATTR(color_left, 0644, show_color_left_fs, set_color_left_fs); +static DEVICE_ATTR(color_center, 0644, show_color_center_fs, + set_color_center_fs); +static DEVICE_ATTR(color_right, 0644, show_color_right_fs, set_color_right_fs); +static DEVICE_ATTR(color_extra, 0644, show_color_extra_fs, set_color_extra_fs); +static DEVICE_ATTR(brightness, 0644, show_brightness_fs, set_brightness_fs); +static DEVICE_ATTR(mode, 0644, show_mode_fs, set_mode_fs); +static DEVICE_ATTR(extra, 0444, show_hasextra_fs, NULL); + // Sysfs Interface for the keyboard state (ON / OFF) static ssize_t show_state_fs(struct device *child, struct device_attribute *attr, char *buffer) diff --git a/src/tuxedo_keyboard.h b/src/tuxedo_keyboard.h index 597cb12..c10c486 100644 --- a/src/tuxedo_keyboard.h +++ b/src/tuxedo_keyboard.h @@ -80,15 +80,4 @@ -// Sysfs device Attributes -static DEVICE_ATTR(state, 0644, show_state_fs, set_state_fs); -static DEVICE_ATTR(color_left, 0644, show_color_left_fs, set_color_left_fs); -static DEVICE_ATTR(color_center, 0644, show_color_center_fs, - set_color_center_fs); -static DEVICE_ATTR(color_right, 0644, show_color_right_fs, set_color_right_fs); -static DEVICE_ATTR(color_extra, 0644, show_color_extra_fs, set_color_extra_fs); -static DEVICE_ATTR(brightness, 0644, show_brightness_fs, set_brightness_fs); -static DEVICE_ATTR(mode, 0644, show_mode_fs, set_mode_fs); -static DEVICE_ATTR(extra, 0444, show_hasextra_fs, NULL); - #endif