diff options
Diffstat (limited to 'drivers/platform/x86/classmate-laptop.c')
-rw-r--r-- | drivers/platform/x86/classmate-laptop.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c index 3bf399fe2bbc..341cbfef93ee 100644 --- a/drivers/platform/x86/classmate-laptop.c +++ b/drivers/platform/x86/classmate-laptop.c | |||
@@ -208,7 +208,7 @@ static ssize_t cmpc_accel_sensitivity_store(struct device *dev, | |||
208 | return strnlen(buf, count); | 208 | return strnlen(buf, count); |
209 | } | 209 | } |
210 | 210 | ||
211 | struct device_attribute cmpc_accel_sensitivity_attr = { | 211 | static struct device_attribute cmpc_accel_sensitivity_attr = { |
212 | .attr = { .name = "sensitivity", .mode = 0660 }, | 212 | .attr = { .name = "sensitivity", .mode = 0660 }, |
213 | .show = cmpc_accel_sensitivity_show, | 213 | .show = cmpc_accel_sensitivity_show, |
214 | .store = cmpc_accel_sensitivity_store | 214 | .store = cmpc_accel_sensitivity_store |
@@ -573,16 +573,17 @@ static int cmpc_ipml_add(struct acpi_device *acpi) | |||
573 | 573 | ||
574 | ipml->rf = rfkill_alloc("cmpc_rfkill", &acpi->dev, RFKILL_TYPE_WLAN, | 574 | ipml->rf = rfkill_alloc("cmpc_rfkill", &acpi->dev, RFKILL_TYPE_WLAN, |
575 | &cmpc_rfkill_ops, acpi->handle); | 575 | &cmpc_rfkill_ops, acpi->handle); |
576 | /* rfkill_alloc may fail if RFKILL is disabled. We should still work | 576 | /* |
577 | * anyway. */ | 577 | * If RFKILL is disabled, rfkill_alloc will return ERR_PTR(-ENODEV). |
578 | if (!IS_ERR(ipml->rf)) { | 578 | * This is OK, however, since all other uses of the device will not |
579 | * derefence it. | ||
580 | */ | ||
581 | if (ipml->rf) { | ||
579 | retval = rfkill_register(ipml->rf); | 582 | retval = rfkill_register(ipml->rf); |
580 | if (retval) { | 583 | if (retval) { |
581 | rfkill_destroy(ipml->rf); | 584 | rfkill_destroy(ipml->rf); |
582 | ipml->rf = NULL; | 585 | ipml->rf = NULL; |
583 | } | 586 | } |
584 | } else { | ||
585 | ipml->rf = NULL; | ||
586 | } | 587 | } |
587 | 588 | ||
588 | dev_set_drvdata(&acpi->dev, ipml); | 589 | dev_set_drvdata(&acpi->dev, ipml); |