Removed every init code, already present in sony_nc_snc_setup and sony_nc_snc_resume. Now calling only the handles present on the device, using the new setup and resume code.

Signed-off-by: Marco Chiappero <[email protected]>
---

--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1225,18 +1225,14 @@ static acpi_status sony_walk_callback(ac
 /*
  * ACPI device
  */
-static int sony_nc_function_setup(struct acpi_device *device)
+static int sony_nc_function_setup(unsigned int handle)
 {
        unsigned int result;

-       /* Enable all events */
-       acpi_callsetfunc(sony_nc_acpi_handle, "SN02", 0xffff, &result);
-
-       /* Setup hotkeys */
-       sony_call_snc_handle(0x0100, 0, &result);
-       sony_call_snc_handle(0x0101, 0, &result);
-       sony_call_snc_handle(0x0102, 0x100, &result);
-       sony_call_snc_handle(0x0127, 0, &result);
+       if (handle == 0x0102)
+               sony_call_snc_handle(0x0102, 0x100, &result);
+       else
+               sony_call_snc_handle(handle, 0, &result);

        return 0;
 }
@@ -1711,6 +1707,12 @@ static void sony_nc_snc_setup_handles(st
                dprintk("looking at handle 0x%.4x\n", handle);

                switch (handle) {
+               case 0x0100:
+               case 0x0127:
+               case 0x0101:
+               case 0x0102:
+                       ret = sony_nc_function_setup(handle);
+                       break;
                case 0x0137:
                        ret = sony_nc_kbd_backlight_setup(pd);
                        break;
@@ -1790,7 +1792,6 @@ static int sony_nc_snc_setup(struct plat
                return -2;

        /* setup found handles here */
-       sony_nc_function_setup(sony_nc_acpi_device);
        sony_nc_snc_setup_handles(pd);

        /* Enable all events for the found handles, otherwise return */
@@ -1839,6 +1840,12 @@ static int sony_nc_snc_resume(void)
                dprintk("looking at handle 0x%.4x\n", handle);

                switch (handle) {
+               case 0x0100:
+               case 0x0127:
+               case 0x0101:
+               case 0x0102:
+                       sony_nc_function_setup(handle);
+                       break;
                case 0x0124:
                case 0x0135:
                        /* re-read rfkill state */
@@ -2028,7 +2035,7 @@ static int sony_nc_resume(struct acpi_de
        if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "SN00",
                                         &handle))) {
                dprintk("Doing SNC setup\n");
-               sony_nc_function_setup(device);
+
                sony_nc_snc_resume();
        }
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" 
in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to