Skip to content

Commit

Permalink
toshiba_acpi: Drop the toshiba_ prefix from sysfs function names
Browse files Browse the repository at this point in the history
This patch removes the toshiba_ prefix from all the sysfs function
names and adapted the code according to coding style.

Also a few functions were renamed to match the sysfs entry, as this
patch is a preparation for the next patch to switch to
DEVICE_ATTR_{RO, RW, WO} macros.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
  • Loading branch information
Azael Avalos authored and Darren Hart committed Feb 12, 2015
1 parent 9bd1213 commit 9d30984
Showing 1 changed file with 75 additions and 89 deletions.
164 changes: 75 additions & 89 deletions drivers/platform/x86/toshiba_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1676,15 +1676,15 @@ static const struct backlight_ops toshiba_backlight_data = {
/*
* Sysfs files
*/
static ssize_t toshiba_version_show(struct device *dev,
struct device_attribute *attr, char *buf)
static ssize_t version_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%s\n", TOSHIBA_ACPI_VERSION);
}

static ssize_t toshiba_fan_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t fan_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 result;
Expand All @@ -1707,8 +1707,8 @@ static ssize_t toshiba_fan_store(struct device *dev,
return count;
}

static ssize_t toshiba_fan_show(struct device *dev,
struct device_attribute *attr, char *buf)
static ssize_t fan_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 value;
Expand All @@ -1721,9 +1721,9 @@ static ssize_t toshiba_fan_show(struct device *dev,
return sprintf(buf, "%d\n", value);
}

static ssize_t toshiba_kbd_bl_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t kbd_backlight_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int mode;
Expand Down Expand Up @@ -1778,9 +1778,9 @@ static ssize_t toshiba_kbd_bl_mode_store(struct device *dev,
return count;
}

static ssize_t toshiba_kbd_bl_mode_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t kbd_backlight_mode_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 time;
Expand All @@ -1791,18 +1791,17 @@ static ssize_t toshiba_kbd_bl_mode_show(struct device *dev,
return sprintf(buf, "%i\n", time & SCI_KBD_MODE_MASK);
}

static ssize_t toshiba_kbd_type_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t kbd_type_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);

return sprintf(buf, "%d\n", toshiba->kbd_type);
}

static ssize_t toshiba_available_kbd_modes_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t available_kbd_modes_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);

Expand All @@ -1814,9 +1813,9 @@ static ssize_t toshiba_available_kbd_modes_show(struct device *dev,
SCI_KBD_MODE_AUTO, SCI_KBD_MODE_ON, SCI_KBD_MODE_OFF);
}

static ssize_t toshiba_kbd_bl_timeout_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t kbd_backlight_timeout_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int time;
Expand Down Expand Up @@ -1857,9 +1856,9 @@ static ssize_t toshiba_kbd_bl_timeout_store(struct device *dev,
return count;
}

static ssize_t toshiba_kbd_bl_timeout_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t kbd_backlight_timeout_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 time;
Expand All @@ -1870,9 +1869,9 @@ static ssize_t toshiba_kbd_bl_timeout_show(struct device *dev,
return sprintf(buf, "%i\n", time >> HCI_MISC_SHIFT);
}

static ssize_t toshiba_touchpad_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t touchpad_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int state;
Expand All @@ -1892,8 +1891,8 @@ static ssize_t toshiba_touchpad_store(struct device *dev,
return count;
}

static ssize_t toshiba_touchpad_show(struct device *dev,
struct device_attribute *attr, char *buf)
static ssize_t touchpad_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 state;
Expand All @@ -1906,8 +1905,8 @@ static ssize_t toshiba_touchpad_show(struct device *dev,
return sprintf(buf, "%i\n", state);
}

static ssize_t toshiba_position_show(struct device *dev,
struct device_attribute *attr, char *buf)
static ssize_t position_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 xyval, zval, tmp;
Expand All @@ -1927,9 +1926,8 @@ static ssize_t toshiba_position_show(struct device *dev,
return sprintf(buf, "%d %d %d\n", x, y, z);
}

static ssize_t toshiba_usb_sleep_charge_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t usb_sleep_charge_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 mode;
Expand All @@ -1942,9 +1940,9 @@ static ssize_t toshiba_usb_sleep_charge_show(struct device *dev,
return sprintf(buf, "%x\n", mode & SCI_USB_CHARGE_MODE_MASK);
}

static ssize_t toshiba_usb_sleep_charge_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t usb_sleep_charge_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 mode;
Expand Down Expand Up @@ -2038,9 +2036,8 @@ static ssize_t sleep_functions_on_battery_store(struct device *dev,
return count;
}

static ssize_t toshiba_usb_rapid_charge_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t usb_rapid_charge_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 state;
Expand All @@ -2053,9 +2050,9 @@ static ssize_t toshiba_usb_rapid_charge_show(struct device *dev,
return sprintf(buf, "%d\n", state);
}

static ssize_t toshiba_usb_rapid_charge_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t usb_rapid_charge_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int state;
Expand All @@ -2074,9 +2071,8 @@ static ssize_t toshiba_usb_rapid_charge_store(struct device *dev,
return count;
}

static ssize_t toshiba_usb_sleep_music_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t usb_sleep_music_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 state;
Expand All @@ -2089,9 +2085,9 @@ static ssize_t toshiba_usb_sleep_music_show(struct device *dev,
return sprintf(buf, "%d\n", state);
}

static ssize_t toshiba_usb_sleep_music_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t usb_sleep_music_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int state;
Expand All @@ -2110,9 +2106,8 @@ static ssize_t toshiba_usb_sleep_music_store(struct device *dev,
return count;
}

static ssize_t toshiba_kbd_function_keys_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t kbd_function_keys_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int mode;
Expand All @@ -2125,9 +2120,9 @@ static ssize_t toshiba_kbd_function_keys_show(struct device *dev,
return sprintf(buf, "%d\n", mode);
}

static ssize_t toshiba_kbd_function_keys_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t kbd_function_keys_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int mode;
Expand All @@ -2152,9 +2147,8 @@ static ssize_t toshiba_kbd_function_keys_store(struct device *dev,
return count;
}

static ssize_t toshiba_panel_power_on_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t panel_power_on_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 state;
Expand All @@ -2167,9 +2161,9 @@ static ssize_t toshiba_panel_power_on_show(struct device *dev,
return sprintf(buf, "%d\n", state);
}

static ssize_t toshiba_panel_power_on_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t panel_power_on_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int state;
Expand All @@ -2190,9 +2184,8 @@ static ssize_t toshiba_panel_power_on_store(struct device *dev,
return count;
}

static ssize_t toshiba_usb_three_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static ssize_t usb_three_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 state;
Expand All @@ -2205,9 +2198,9 @@ static ssize_t toshiba_usb_three_show(struct device *dev,
return sprintf(buf, "%d\n", state);
}

static ssize_t toshiba_usb_three_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t usb_three_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int state;
Expand All @@ -2232,39 +2225,32 @@ static ssize_t toshiba_usb_three_store(struct device *dev,
return count;
}

static DEVICE_ATTR(version, S_IRUGO, toshiba_version_show, NULL);
static DEVICE_ATTR(fan, S_IRUGO | S_IWUSR,
toshiba_fan_show, toshiba_fan_store);
static DEVICE_ATTR(version, S_IRUGO, version_show, NULL);
static DEVICE_ATTR(fan, S_IRUGO | S_IWUSR, fan_show, fan_store);
static DEVICE_ATTR(kbd_backlight_mode, S_IRUGO | S_IWUSR,
toshiba_kbd_bl_mode_show, toshiba_kbd_bl_mode_store);
static DEVICE_ATTR(kbd_type, S_IRUGO, toshiba_kbd_type_show, NULL);
kbd_backlight_mode_show, kbd_backlight_mode_store);
static DEVICE_ATTR(kbd_type, S_IRUGO, kbd_type_show, NULL);
static DEVICE_ATTR(available_kbd_modes, S_IRUGO,
toshiba_available_kbd_modes_show, NULL);
available_kbd_modes_show, NULL);
static DEVICE_ATTR(kbd_backlight_timeout, S_IRUGO | S_IWUSR,
toshiba_kbd_bl_timeout_show, toshiba_kbd_bl_timeout_store);
static DEVICE_ATTR(touchpad, S_IRUGO | S_IWUSR,
toshiba_touchpad_show, toshiba_touchpad_store);
static DEVICE_ATTR(position, S_IRUGO, toshiba_position_show, NULL);
kbd_backlight_timeout_show, kbd_backlight_timeout_store);
static DEVICE_ATTR(touchpad, S_IRUGO | S_IWUSR, touchpad_show, touchpad_store);
static DEVICE_ATTR(position, S_IRUGO, position_show, NULL);
static DEVICE_ATTR(usb_sleep_charge, S_IRUGO | S_IWUSR,
toshiba_usb_sleep_charge_show,
toshiba_usb_sleep_charge_store);
usb_sleep_charge_show, usb_sleep_charge_store);
static DEVICE_ATTR(sleep_functions_on_battery, S_IRUGO | S_IWUSR,
sleep_functions_on_battery_show,
sleep_functions_on_battery_store);
static DEVICE_ATTR(usb_rapid_charge, S_IRUGO | S_IWUSR,
toshiba_usb_rapid_charge_show,
toshiba_usb_rapid_charge_store);
usb_rapid_charge_show, usb_rapid_charge_store);
static DEVICE_ATTR(usb_sleep_music, S_IRUGO | S_IWUSR,
toshiba_usb_sleep_music_show,
toshiba_usb_sleep_music_store);
usb_sleep_music_show, usb_sleep_music_store);
static DEVICE_ATTR(kbd_function_keys, S_IRUGO | S_IWUSR,
toshiba_kbd_function_keys_show,
toshiba_kbd_function_keys_store);
kbd_function_keys_show, kbd_function_keys_store);
static DEVICE_ATTR(panel_power_on, S_IRUGO | S_IWUSR,
toshiba_panel_power_on_show,
toshiba_panel_power_on_store);
panel_power_on_show, panel_power_on_store);
static DEVICE_ATTR(usb_three, S_IRUGO | S_IWUSR,
toshiba_usb_three_show, toshiba_usb_three_store);
usb_three_show, usb_three_store);

static struct attribute *toshiba_attributes[] = {
&dev_attr_version.attr,
Expand Down

0 comments on commit 9d30984

Please sign in to comment.