diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/sony-laptop.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 7707cc25f3a2..7d8bebec2961 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -2317,8 +2317,6 @@ static int sony_pic_remove(struct acpi_device *device, int type) | |||
2317 | struct sony_pic_ioport *io, *tmp_io; | 2317 | struct sony_pic_ioport *io, *tmp_io; |
2318 | struct sony_pic_irq *irq, *tmp_irq; | 2318 | struct sony_pic_irq *irq, *tmp_irq; |
2319 | 2319 | ||
2320 | sonypi_compat_exit(); | ||
2321 | |||
2322 | if (sony_pic_disable(device)) { | 2320 | if (sony_pic_disable(device)) { |
2323 | printk(KERN_ERR DRV_PFX "Couldn't disable device.\n"); | 2321 | printk(KERN_ERR DRV_PFX "Couldn't disable device.\n"); |
2324 | return -ENXIO; | 2322 | return -ENXIO; |
@@ -2328,6 +2326,8 @@ static int sony_pic_remove(struct acpi_device *device, int type) | |||
2328 | release_region(spic_dev.cur_ioport->io.minimum, | 2326 | release_region(spic_dev.cur_ioport->io.minimum, |
2329 | spic_dev.cur_ioport->io.address_length); | 2327 | spic_dev.cur_ioport->io.address_length); |
2330 | 2328 | ||
2329 | sonypi_compat_exit(); | ||
2330 | |||
2331 | sony_laptop_remove_input(); | 2331 | sony_laptop_remove_input(); |
2332 | 2332 | ||
2333 | /* pf attrs */ | 2333 | /* pf attrs */ |
@@ -2393,6 +2393,9 @@ static int sony_pic_add(struct acpi_device *device) | |||
2393 | goto err_free_resources; | 2393 | goto err_free_resources; |
2394 | } | 2394 | } |
2395 | 2395 | ||
2396 | if (sonypi_compat_init()) | ||
2397 | goto err_remove_input; | ||
2398 | |||
2396 | /* request io port */ | 2399 | /* request io port */ |
2397 | list_for_each_entry(io, &spic_dev.ioports, list) { | 2400 | list_for_each_entry(io, &spic_dev.ioports, list) { |
2398 | if (request_region(io->io.minimum, io->io.address_length, | 2401 | if (request_region(io->io.minimum, io->io.address_length, |
@@ -2407,7 +2410,7 @@ static int sony_pic_add(struct acpi_device *device) | |||
2407 | if (!spic_dev.cur_ioport) { | 2410 | if (!spic_dev.cur_ioport) { |
2408 | printk(KERN_ERR DRV_PFX "Failed to request_region.\n"); | 2411 | printk(KERN_ERR DRV_PFX "Failed to request_region.\n"); |
2409 | result = -ENODEV; | 2412 | result = -ENODEV; |
2410 | goto err_remove_input; | 2413 | goto err_remove_compat; |
2411 | } | 2414 | } |
2412 | 2415 | ||
2413 | /* request IRQ */ | 2416 | /* request IRQ */ |
@@ -2447,9 +2450,6 @@ static int sony_pic_add(struct acpi_device *device) | |||
2447 | if (result) | 2450 | if (result) |
2448 | goto err_remove_pf; | 2451 | goto err_remove_pf; |
2449 | 2452 | ||
2450 | if (sonypi_compat_init()) | ||
2451 | goto err_remove_pf; | ||
2452 | |||
2453 | return 0; | 2453 | return 0; |
2454 | 2454 | ||
2455 | err_remove_pf: | 2455 | err_remove_pf: |
@@ -2465,6 +2465,9 @@ err_release_region: | |||
2465 | release_region(spic_dev.cur_ioport->io.minimum, | 2465 | release_region(spic_dev.cur_ioport->io.minimum, |
2466 | spic_dev.cur_ioport->io.address_length); | 2466 | spic_dev.cur_ioport->io.address_length); |
2467 | 2467 | ||
2468 | err_remove_compat: | ||
2469 | sonypi_compat_exit(); | ||
2470 | |||
2468 | err_remove_input: | 2471 | err_remove_input: |
2469 | sony_laptop_remove_input(); | 2472 | sony_laptop_remove_input(); |
2470 | 2473 | ||