toshiba_acpi: Clean file according to coding style
This patch simply cleans the the driver out of 2 errors and 17 warnings according to "checkpatch -f", no functionality was changed, simply a cleanup. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
This commit is contained in:
parent
7216d7021d
commit
b516399272
1 changed files with 23 additions and 15 deletions
|
@ -57,7 +57,7 @@
|
||||||
#include <linux/i8042.h>
|
#include <linux/i8042.h>
|
||||||
#include <linux/acpi.h>
|
#include <linux/acpi.h>
|
||||||
#include <linux/dmi.h>
|
#include <linux/dmi.h>
|
||||||
#include <asm/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
MODULE_AUTHOR("John Belmonte");
|
MODULE_AUTHOR("John Belmonte");
|
||||||
MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver");
|
MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver");
|
||||||
|
@ -289,7 +289,7 @@ static const struct key_entry toshiba_acpi_alt_keymap[] = {
|
||||||
/* utility
|
/* utility
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static __inline__ void _set_bit(u32 * word, u32 mask, int value)
|
static inline void _set_bit(u32 *word, u32 mask, int value)
|
||||||
{
|
{
|
||||||
*word = (*word & ~mask) | (mask * value);
|
*word = (*word & ~mask) | (mask * value);
|
||||||
}
|
}
|
||||||
|
@ -332,9 +332,8 @@ static acpi_status tci_raw(struct toshiba_acpi_dev *dev,
|
||||||
(char *)dev->method_hci, ¶ms,
|
(char *)dev->method_hci, ¶ms,
|
||||||
&results);
|
&results);
|
||||||
if ((status == AE_OK) && (out_objs->package.count <= TCI_WORDS)) {
|
if ((status == AE_OK) && (out_objs->package.count <= TCI_WORDS)) {
|
||||||
for (i = 0; i < out_objs->package.count; ++i) {
|
for (i = 0; i < out_objs->package.count; ++i)
|
||||||
out[i] = out_objs->package.elements[i].integer.value;
|
out[i] = out_objs->package.elements[i].integer.value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
@ -360,6 +359,7 @@ static u32 hci_read1(struct toshiba_acpi_dev *dev, u32 reg, u32 *out1)
|
||||||
u32 in[TCI_WORDS] = { HCI_GET, reg, 0, 0, 0, 0 };
|
u32 in[TCI_WORDS] = { HCI_GET, reg, 0, 0, 0, 0 };
|
||||||
u32 out[TCI_WORDS];
|
u32 out[TCI_WORDS];
|
||||||
acpi_status status = tci_raw(dev, in, out);
|
acpi_status status = tci_raw(dev, in, out);
|
||||||
|
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_FAILURE(status))
|
||||||
return TOS_FAILURE;
|
return TOS_FAILURE;
|
||||||
|
|
||||||
|
@ -377,11 +377,13 @@ static u32 hci_write2(struct toshiba_acpi_dev *dev, u32 reg, u32 in1, u32 in2)
|
||||||
return ACPI_SUCCESS(status) ? out[0] : TOS_FAILURE;
|
return ACPI_SUCCESS(status) ? out[0] : TOS_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 hci_read2(struct toshiba_acpi_dev *dev, u32 reg, u32 *out1, u32 *out2)
|
static u32 hci_read2(struct toshiba_acpi_dev *dev,
|
||||||
|
u32 reg, u32 *out1, u32 *out2)
|
||||||
{
|
{
|
||||||
u32 in[TCI_WORDS] = { HCI_GET, reg, *out1, *out2, 0, 0 };
|
u32 in[TCI_WORDS] = { HCI_GET, reg, *out1, *out2, 0, 0 };
|
||||||
u32 out[TCI_WORDS];
|
u32 out[TCI_WORDS];
|
||||||
acpi_status status = tci_raw(dev, in, out);
|
acpi_status status = tci_raw(dev, in, out);
|
||||||
|
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_FAILURE(status))
|
||||||
return TOS_FAILURE;
|
return TOS_FAILURE;
|
||||||
|
|
||||||
|
@ -456,6 +458,7 @@ static u32 sci_read(struct toshiba_acpi_dev *dev, u32 reg, u32 *out1)
|
||||||
u32 in[TCI_WORDS] = { SCI_GET, reg, 0, 0, 0, 0 };
|
u32 in[TCI_WORDS] = { SCI_GET, reg, 0, 0, 0, 0 };
|
||||||
u32 out[TCI_WORDS];
|
u32 out[TCI_WORDS];
|
||||||
acpi_status status = tci_raw(dev, in, out);
|
acpi_status status = tci_raw(dev, in, out);
|
||||||
|
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_FAILURE(status))
|
||||||
return TOS_FAILURE;
|
return TOS_FAILURE;
|
||||||
|
|
||||||
|
@ -730,7 +733,8 @@ static int toshiba_eco_mode_available(struct toshiba_acpi_dev *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum led_brightness toshiba_eco_mode_get_status(struct led_classdev *cdev)
|
static enum led_brightness
|
||||||
|
toshiba_eco_mode_get_status(struct led_classdev *cdev)
|
||||||
{
|
{
|
||||||
struct toshiba_acpi_dev *dev = container_of(cdev,
|
struct toshiba_acpi_dev *dev = container_of(cdev,
|
||||||
struct toshiba_acpi_dev, eco_led);
|
struct toshiba_acpi_dev, eco_led);
|
||||||
|
@ -1252,7 +1256,7 @@ static int set_tr_backlight_status(struct toshiba_acpi_dev *dev, bool enable)
|
||||||
return hci_result == TOS_SUCCESS ? 0 : -EIO;
|
return hci_result == TOS_SUCCESS ? 0 : -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct proc_dir_entry *toshiba_proc_dir /*= 0*/ ;
|
static struct proc_dir_entry *toshiba_proc_dir /*= 0*/;
|
||||||
|
|
||||||
static int __get_lcd_brightness(struct toshiba_acpi_dev *dev)
|
static int __get_lcd_brightness(struct toshiba_acpi_dev *dev)
|
||||||
{
|
{
|
||||||
|
@ -1263,6 +1267,7 @@ static int __get_lcd_brightness(struct toshiba_acpi_dev *dev)
|
||||||
if (dev->tr_backlight_supported) {
|
if (dev->tr_backlight_supported) {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
int ret = get_tr_backlight_status(dev, &enabled);
|
int ret = get_tr_backlight_status(dev, &enabled);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
if (enabled)
|
if (enabled)
|
||||||
|
@ -1280,6 +1285,7 @@ static int __get_lcd_brightness(struct toshiba_acpi_dev *dev)
|
||||||
static int get_lcd_brightness(struct backlight_device *bd)
|
static int get_lcd_brightness(struct backlight_device *bd)
|
||||||
{
|
{
|
||||||
struct toshiba_acpi_dev *dev = bl_get_data(bd);
|
struct toshiba_acpi_dev *dev = bl_get_data(bd);
|
||||||
|
|
||||||
return __get_lcd_brightness(dev);
|
return __get_lcd_brightness(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1316,6 +1322,7 @@ static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value)
|
||||||
if (dev->tr_backlight_supported) {
|
if (dev->tr_backlight_supported) {
|
||||||
bool enable = !value;
|
bool enable = !value;
|
||||||
int ret = set_tr_backlight_status(dev, enable);
|
int ret = set_tr_backlight_status(dev, enable);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
if (value)
|
if (value)
|
||||||
|
@ -1330,6 +1337,7 @@ static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value)
|
||||||
static int set_lcd_status(struct backlight_device *bd)
|
static int set_lcd_status(struct backlight_device *bd)
|
||||||
{
|
{
|
||||||
struct toshiba_acpi_dev *dev = bl_get_data(bd);
|
struct toshiba_acpi_dev *dev = bl_get_data(bd);
|
||||||
|
|
||||||
return set_lcd_brightness(dev, bd->props.brightness);
|
return set_lcd_brightness(dev, bd->props.brightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1387,6 +1395,7 @@ static int video_proc_show(struct seq_file *m, void *v)
|
||||||
int is_lcd = (value & HCI_VIDEO_OUT_LCD) ? 1 : 0;
|
int is_lcd = (value & HCI_VIDEO_OUT_LCD) ? 1 : 0;
|
||||||
int is_crt = (value & HCI_VIDEO_OUT_CRT) ? 1 : 0;
|
int is_crt = (value & HCI_VIDEO_OUT_CRT) ? 1 : 0;
|
||||||
int is_tv = (value & HCI_VIDEO_OUT_TV) ? 1 : 0;
|
int is_tv = (value & HCI_VIDEO_OUT_TV) ? 1 : 0;
|
||||||
|
|
||||||
seq_printf(m, "lcd_out: %d\n", is_lcd);
|
seq_printf(m, "lcd_out: %d\n", is_lcd);
|
||||||
seq_printf(m, "crt_out: %d\n", is_crt);
|
seq_printf(m, "crt_out: %d\n", is_crt);
|
||||||
seq_printf(m, "tv_out: %d\n", is_tv);
|
seq_printf(m, "tv_out: %d\n", is_tv);
|
||||||
|
@ -1439,8 +1448,7 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf,
|
||||||
do {
|
do {
|
||||||
++buffer;
|
++buffer;
|
||||||
--remain;
|
--remain;
|
||||||
}
|
} while (remain && *(buffer - 1) != ';');
|
||||||
while (remain && *(buffer - 1) != ';');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(cmd);
|
kfree(cmd);
|
||||||
|
@ -1448,6 +1456,7 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf,
|
||||||
ret = get_video_status(dev, &video_out);
|
ret = get_video_status(dev, &video_out);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
unsigned int new_video_out = video_out;
|
unsigned int new_video_out = video_out;
|
||||||
|
|
||||||
if (lcd_out != -1)
|
if (lcd_out != -1)
|
||||||
_set_bit(&new_video_out, HCI_VIDEO_OUT_LCD, lcd_out);
|
_set_bit(&new_video_out, HCI_VIDEO_OUT_LCD, lcd_out);
|
||||||
if (crt_out != -1)
|
if (crt_out != -1)
|
||||||
|
@ -1517,10 +1526,10 @@ static ssize_t fan_proc_write(struct file *file, const char __user *buf,
|
||||||
if (sscanf(cmd, " force_on : %i", &value) == 1 &&
|
if (sscanf(cmd, " force_on : %i", &value) == 1 &&
|
||||||
value >= 0 && value <= 1) {
|
value >= 0 && value <= 1) {
|
||||||
hci_result = hci_write1(dev, HCI_FAN, value);
|
hci_result = hci_write1(dev, HCI_FAN, value);
|
||||||
if (hci_result != TOS_SUCCESS)
|
if (hci_result == TOS_SUCCESS)
|
||||||
return -EIO;
|
|
||||||
else
|
|
||||||
dev->force_fan = value;
|
dev->force_fan = value;
|
||||||
|
else
|
||||||
|
return -EIO;
|
||||||
} else {
|
} else {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -1585,11 +1594,10 @@ static ssize_t keys_proc_write(struct file *file, const char __user *buf,
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
cmd[len] = '\0';
|
cmd[len] = '\0';
|
||||||
|
|
||||||
if (sscanf(cmd, " hotkey_ready : %i", &value) == 1 && value == 0) {
|
if (sscanf(cmd, " hotkey_ready : %i", &value) == 1 && value == 0)
|
||||||
dev->key_event_valid = 0;
|
dev->key_event_valid = 0;
|
||||||
} else {
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue