diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index d726db3..2349e88 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -107,16 +107,8 @@
  * Flags for hotk status
  * WL_ON and BT_ON are also used for wireless_status()
  */
-#define WL_ON		0x01	/* internal Wifi */
-#define BT_ON		0x02	/* internal Bluetooth */
-#define MLED_ON		0x04	/* mail LED */
-#define TLED_ON		0x08	/* touchpad LED */
-#define RLED_ON		0x10	/* Record LED */
-#define PLED_ON		0x20	/* Phone LED */
-#define GLED_ON		0x40	/* Gaming LED */
-#define LCD_ON		0x80	/* LCD backlight */
-#define GPS_ON		0x100	/* GPS */
-#define KEY_ON		0x200	/* Keyboard backlight */
+#define WL_RSTS		0x01	/* internal Wifi */
+#define BT_RSTS		0x02	/* internal Bluetooth */
 
 #define ASUS_HANDLE(object, paths...)					\
 	static acpi_handle  object##_handle = NULL;			\
@@ -244,7 +236,6 @@
 	int lcd_state;
 
 	acpi_handle handle;	/* the handle of the hotk device */
-	char status;		/* status of the hotk, for LEDs, ... */
 	u32 ledd_status;	/* status of the LED display */
 	u8 light_level;		/* light sensor level */
 	u8 light_switch;	/* light sensor switch value */
@@ -332,35 +323,18 @@
 	return write_acpi_int_ret(handle, method, val, NULL);
 }
 
-/* Generic LED functions */
-static int read_status(struct asus_laptop *asus, int mask)
+/* Generic LED function */
+static void asus_led_set(struct asus_laptop *asus, acpi_handle handle,
+			 int value)
 {
-	return (asus->status & mask) ? 1 : 0;
-}
+	if (handle == mled_set_handle)
+		value = !value;
+	else if (handle == gled_set_handle)
+		value = !value + 1;
+	else
+		value = !!value;
 
-static void write_status(struct asus_laptop *asus, acpi_handle handle,
-			 int out, int mask)
-{
-	asus->status = (out) ? (asus->status | mask) : (asus->status & ~mask);
-
-	switch (mask) {
-	case MLED_ON:
-		out = !(out & 0x1);
-		break;
-	case GLED_ON:
-		out = (out & 0x1) + 1;
-		break;
-	case GPS_ON:
-		handle = (out) ? gps_on_handle : gps_off_handle;
-		out = 0x02;
-		break;
-	default:
-		out &= 0x1;
-		break;
-	}
-
-	if (write_acpi_int(handle, NULL, out))
-		pr_warning(" write failed %x\n", mask);
+	write_acpi_int(handle, NULL, value);
 }
 
 /*
@@ -403,7 +377,7 @@
 		struct asus_laptop *asus = work_to_asus(work, object);	\
 									\
 		int value = asus->leds.object##_wk;			\
-		write_status(asus, object##_set_handle, value, (mask));	\
+		asus_led_set(asus, object##_set_handle, value);		\
 	}								\
 	static enum led_brightness object##_led_get(			\
 		struct led_classdev *led_cdev)				\
@@ -740,9 +714,9 @@
 	return count;
 }
 
-static ssize_t store_status(struct asus_laptop *asus,
-			    const char *buf, size_t count,
-			    acpi_handle handle, int mask)
+static ssize_t sysfs_acpi_set(struct asus_laptop *asus,
+			      const char *buf, size_t count,
+			      acpi_handle handle)
 {
 	int rv, value;
 	int out = 0;
@@ -751,8 +725,8 @@
 	if (rv > 0)
 		out = value ? 1 : 0;
 
-	write_status(asus, handle, out, mask);
-
+	if (write_acpi_int(handle, NULL, value))
+		return -ENODEV;
 	return rv;
 }
 
@@ -810,7 +784,7 @@
 {
 	struct asus_laptop *asus = dev_get_drvdata(dev);
 
-	return sprintf(buf, "%d\n", asus_wireless_status(asus, WL_ON));
+	return sprintf(buf, "%d\n", asus_wireless_status(asus, WL_RSTS));
 }
 
 static ssize_t store_wlan(struct device *dev, struct device_attribute *attr,
@@ -818,7 +792,7 @@
 {
 	struct asus_laptop *asus = dev_get_drvdata(dev);
 
-	return store_status(asus, buf, count, wl_switch_handle, WL_ON);
+	return sysfs_acpi_set(asus, buf, count, wl_switch_handle);
 }
 
 /*
@@ -829,7 +803,7 @@
 {
 	struct asus_laptop *asus = dev_get_drvdata(dev);
 
-	return sprintf(buf, "%d\n", asus_wireless_status(asus, BT_ON));
+	return sprintf(buf, "%d\n", asus_wireless_status(asus, BT_RSTS));
 }
 
 static ssize_t store_bluetooth(struct device *dev,
@@ -838,7 +812,7 @@
 {
 	struct asus_laptop *asus = dev_get_drvdata(dev);
 
-	return store_status(asus, buf, count, bt_switch_handle, BT_ON);
+	return sysfs_acpi_set(asus, buf, count, bt_switch_handle);
 }
 
 /*
@@ -1439,16 +1413,9 @@
 
 	/* WLED and BLED are on by default */
 	if (bluetooth_status >= 0)
-		write_status(asus, bt_switch_handle, !!bluetooth_status, BT_ON);
+		write_acpi_int(bt_switch_handle, NULL, !!bluetooth_status);
 	if (wireless_status >= 0)
-		write_status(asus, wl_switch_handle, !!wireless_status, WL_ON);
-
-	/* If the h/w switch is off, we need to check the real status */
-	write_status(asus, NULL, asus_wireless_status(asus, BT_ON), BT_ON);
-	write_status(asus, NULL, asus_wireless_status(asus, WL_ON), WL_ON);
-
-	/* LCD Backlight is on by default */
-	write_status(asus, NULL, 1, LCD_ON);
+		write_acpi_int(wl_switch_handle, NULL, !!wireless_status);
 
 	/* Keyboard Backlight is on by default */
 	if (kled_set_handle)
