Commit 5c9ed5be authored by Szymon Janc's avatar Szymon Janc Committed by Greg Kroah-Hartman
Browse files

Staging: quickstart: Some style, whitespaces and typos fixes

parent b154ff05
Loading
Loading
Loading
Loading
+39 −41
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
 *
 *  Copyright (C) 2007-2010 Angelo Arrifano <miknix@gmail.com>
 *
 *  Information gathered from disassebled dsdt and from here:
 *  Information gathered from disassembled dsdt and from here:
 *  <http://www.microsoft.com/whdc/system/platform/firmware/DirAppLaunch.mspx>
 *
 *  This program is free software; you can redistribute it and/or modify
@@ -47,9 +47,11 @@ MODULE_LICENSE("GPL");

#define QUICKSTART_MAX_BTN_NAME_LEN	16

/* There will be two events:
/*
 * There will be two events:
 * 0x02 - A hot button was pressed while device was off/sleeping.
	 * 0x80 - A hot button was pressed while device was up. */
 * 0x80 - A hot button was pressed while device was up.
 */
#define QUICKSTART_EVENT_WAKE		0x02
#define QUICKSTART_EVENT_RUNTIME	0x80

@@ -64,7 +66,7 @@ static struct quickstart_driver_data {
	struct quickstart_btn *pressed;
} quickstart_data;

/* ACPI driver Structs */
/* ACPI driver structs */
struct quickstart_acpi {
	struct acpi_device *device;
	struct quickstart_btn *btn;
@@ -111,9 +113,7 @@ static struct platform_driver pf_driver = {
	}
};

/*
 * Platform driver functions
 */
/* Platform driver functions */
static ssize_t buttons_show(struct device *dev,
					struct device_attribute *attr,
					char *buf)
@@ -160,7 +160,7 @@ static ssize_t pressed_button_store(struct device *dev,
	return count;
}

/* Hotstart Helper functions */
/* Helper functions */
static int quickstart_btnlst_add(struct quickstart_btn **data)
{
	struct quickstart_btn **ptr = &quickstart_data.btn_lst;
@@ -240,10 +240,12 @@ static void quickstart_acpi_ghid(struct quickstart_acpi *quickstart)
	if (!quickstart)
		return;

	/* This returns a buffer telling the button usage ID,
	 * and triggers pending notify events (The ones before booting). */
	status = acpi_evaluate_object(quickstart->device->handle,
					"GHID", NULL, &buffer);
	/*
	 * This returns a buffer telling the button usage ID,
	 * and triggers pending notify events (The ones before booting).
	 */
	status = acpi_evaluate_object(quickstart->device->handle, "GHID", NULL,
								&buffer);
	if (ACPI_FAILURE(status) || !buffer.pointer) {
		printk(KERN_ERR "quickstart: %s GHID method failed.\n",
						quickstart->btn->name);
@@ -253,9 +255,11 @@ static void quickstart_acpi_ghid(struct quickstart_acpi *quickstart)
	if (buffer.length < 8)
		return;

	/* <<The GHID method can return a BYTE, WORD, or DWORD.
	/*
	 * <<The GHID method can return a BYTE, WORD, or DWORD.
	 * The value must be encoded in little-endian byte
	 * order (least significant byte first).>> */
	 * order (least significant byte first).>>
	 */
	usageid = *((uint32_t *)(buffer.pointer + (buffer.length - 8)));
	quickstart->btn->id = usageid;

@@ -339,20 +343,17 @@ static int quickstart_acpi_remove(struct acpi_device *device, int type)

	quickstart = acpi_driver_data(device);

	status = acpi_remove_notify_handler(device->handle,
						 ACPI_ALL_NOTIFY,
	status = acpi_remove_notify_handler(device->handle, ACPI_ALL_NOTIFY,
						quickstart_acpi_notify);
	if (ACPI_FAILURE(status))
		printk(KERN_ERR "quickstart: Error removing notify handler\n");


	kfree(quickstart);

	return 0;
}

/* Module functions */

static void quickstart_exit(void)
{
	input_unregister_device(quickstart_input);
@@ -367,8 +368,6 @@ static void quickstart_exit(void)
	acpi_bus_unregister_driver(&quickstart_acpi_driver);

	quickstart_btnlst_free();

	return;
}

static int __init quickstart_init_input(void)
@@ -444,7 +443,6 @@ static int __init quickstart_init(void)
	if (ret)
		goto fail_dev_file2;


	/* Input device */
	ret = quickstart_init_input();
	if (ret)