diff options
| -rw-r--r-- | drivers/platform/x86/sony-laptop.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index d3fd52036fd6..3b32852d6d2d 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
| @@ -1509,7 +1509,6 @@ static void sony_nc_function_resume(void) | |||
| 1509 | static int sony_nc_resume(struct device *dev) | 1509 | static int sony_nc_resume(struct device *dev) |
| 1510 | { | 1510 | { |
| 1511 | struct sony_nc_value *item; | 1511 | struct sony_nc_value *item; |
| 1512 | acpi_handle handle; | ||
| 1513 | 1512 | ||
| 1514 | for (item = sony_nc_values; item->name; item++) { | 1513 | for (item = sony_nc_values; item->name; item++) { |
| 1515 | int ret; | 1514 | int ret; |
| @@ -1524,15 +1523,13 @@ static int sony_nc_resume(struct device *dev) | |||
| 1524 | } | 1523 | } |
| 1525 | } | 1524 | } |
| 1526 | 1525 | ||
| 1527 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "ECON", | 1526 | if (acpi_has_method(sony_nc_acpi_handle, "ECON")) { |
| 1528 | &handle))) { | ||
| 1529 | int arg = 1; | 1527 | int arg = 1; |
| 1530 | if (sony_nc_int_call(sony_nc_acpi_handle, "ECON", &arg, NULL)) | 1528 | if (sony_nc_int_call(sony_nc_acpi_handle, "ECON", &arg, NULL)) |
| 1531 | dprintk("ECON Method failed\n"); | 1529 | dprintk("ECON Method failed\n"); |
| 1532 | } | 1530 | } |
| 1533 | 1531 | ||
| 1534 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "SN00", | 1532 | if (acpi_has_method(sony_nc_acpi_handle, "SN00")) |
| 1535 | &handle))) | ||
| 1536 | sony_nc_function_resume(); | 1533 | sony_nc_function_resume(); |
| 1537 | 1534 | ||
| 1538 | return 0; | 1535 | return 0; |
| @@ -2690,7 +2687,6 @@ static void sony_nc_backlight_ng_read_limits(int handle, | |||
| 2690 | 2687 | ||
| 2691 | static void sony_nc_backlight_setup(void) | 2688 | static void sony_nc_backlight_setup(void) |
| 2692 | { | 2689 | { |
| 2693 | acpi_handle unused; | ||
| 2694 | int max_brightness = 0; | 2690 | int max_brightness = 0; |
| 2695 | const struct backlight_ops *ops = NULL; | 2691 | const struct backlight_ops *ops = NULL; |
| 2696 | struct backlight_properties props; | 2692 | struct backlight_properties props; |
| @@ -2725,8 +2721,7 @@ static void sony_nc_backlight_setup(void) | |||
| 2725 | sony_nc_backlight_ng_read_limits(0x14c, &sony_bl_props); | 2721 | sony_nc_backlight_ng_read_limits(0x14c, &sony_bl_props); |
| 2726 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | 2722 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; |
| 2727 | 2723 | ||
| 2728 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", | 2724 | } else if (acpi_has_method(sony_nc_acpi_handle, "GBRT")) { |
| 2729 | &unused))) { | ||
| 2730 | ops = &sony_backlight_ops; | 2725 | ops = &sony_backlight_ops; |
| 2731 | max_brightness = SONY_MAX_BRIGHTNESS - 1; | 2726 | max_brightness = SONY_MAX_BRIGHTNESS - 1; |
| 2732 | 2727 | ||
| @@ -2758,7 +2753,6 @@ static int sony_nc_add(struct acpi_device *device) | |||
| 2758 | { | 2753 | { |
| 2759 | acpi_status status; | 2754 | acpi_status status; |
| 2760 | int result = 0; | 2755 | int result = 0; |
| 2761 | acpi_handle handle; | ||
| 2762 | struct sony_nc_value *item; | 2756 | struct sony_nc_value *item; |
| 2763 | 2757 | ||
| 2764 | pr_info("%s v%s\n", SONY_NC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION); | 2758 | pr_info("%s v%s\n", SONY_NC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION); |
| @@ -2798,15 +2792,13 @@ static int sony_nc_add(struct acpi_device *device) | |||
| 2798 | goto outplatform; | 2792 | goto outplatform; |
| 2799 | } | 2793 | } |
| 2800 | 2794 | ||
| 2801 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "ECON", | 2795 | if (acpi_has_method(sony_nc_acpi_handle, "ECON")) { |
| 2802 | &handle))) { | ||
| 2803 | int arg = 1; | 2796 | int arg = 1; |
| 2804 | if (sony_nc_int_call(sony_nc_acpi_handle, "ECON", &arg, NULL)) | 2797 | if (sony_nc_int_call(sony_nc_acpi_handle, "ECON", &arg, NULL)) |
| 2805 | dprintk("ECON Method failed\n"); | 2798 | dprintk("ECON Method failed\n"); |
| 2806 | } | 2799 | } |
| 2807 | 2800 | ||
| 2808 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "SN00", | 2801 | if (acpi_has_method(sony_nc_acpi_handle, "SN00")) { |
| 2809 | &handle))) { | ||
| 2810 | dprintk("Doing SNC setup\n"); | 2802 | dprintk("Doing SNC setup\n"); |
| 2811 | /* retrieve the available handles */ | 2803 | /* retrieve the available handles */ |
| 2812 | result = sony_nc_handles_setup(sony_pf_device); | 2804 | result = sony_nc_handles_setup(sony_pf_device); |
| @@ -2829,9 +2821,8 @@ static int sony_nc_add(struct acpi_device *device) | |||
| 2829 | 2821 | ||
| 2830 | /* find the available acpiget as described in the DSDT */ | 2822 | /* find the available acpiget as described in the DSDT */ |
| 2831 | for (; item->acpiget && *item->acpiget; ++item->acpiget) { | 2823 | for (; item->acpiget && *item->acpiget; ++item->acpiget) { |
| 2832 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, | 2824 | if (acpi_has_method(sony_nc_acpi_handle, |
| 2833 | *item->acpiget, | 2825 | *item->acpiget)) { |
| 2834 | &handle))) { | ||
| 2835 | dprintk("Found %s getter: %s\n", | 2826 | dprintk("Found %s getter: %s\n", |
| 2836 | item->name, *item->acpiget); | 2827 | item->name, *item->acpiget); |
| 2837 | item->devattr.attr.mode |= S_IRUGO; | 2828 | item->devattr.attr.mode |= S_IRUGO; |
| @@ -2841,9 +2832,8 @@ static int sony_nc_add(struct acpi_device *device) | |||
| 2841 | 2832 | ||
| 2842 | /* find the available acpiset as described in the DSDT */ | 2833 | /* find the available acpiset as described in the DSDT */ |
| 2843 | for (; item->acpiset && *item->acpiset; ++item->acpiset) { | 2834 | for (; item->acpiset && *item->acpiset; ++item->acpiset) { |
| 2844 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, | 2835 | if (acpi_has_method(sony_nc_acpi_handle, |
| 2845 | *item->acpiset, | 2836 | *item->acpiset)) { |
| 2846 | &handle))) { | ||
| 2847 | dprintk("Found %s setter: %s\n", | 2837 | dprintk("Found %s setter: %s\n", |
| 2848 | item->name, *item->acpiset); | 2838 | item->name, *item->acpiset); |
| 2849 | item->devattr.attr.mode |= S_IWUSR; | 2839 | item->devattr.attr.mode |= S_IWUSR; |
