aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sony-laptop.c
diff options
context:
space:
mode:
authorMattia Dongili <malattia@linux.it>2007-08-12 03:20:27 -0400
committerLen Brown <len.brown@intel.com>2007-08-24 00:57:20 -0400
commit015a916fbbf105bb15f4bbfd80c3b9b2f2e0d7db (patch)
tree1dbcb67d48032c7d782a17864acc9cbb2262a548 /drivers/misc/sony-laptop.c
parentf46d1604ed84e5a4107bae1db7283e3a76d72ace (diff)
sony-laptop: call sonypi_compat_init earlier
sonypi_compat uses a kfifo that needs to be present before _SRS is called to be able to cope with the IRQs triggered when setting resources. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/sony-laptop.c')
-rw-r--r--drivers/misc/sony-laptop.c15
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
2455err_remove_pf: 2455err_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
2468err_remove_compat:
2469 sonypi_compat_exit();
2470
2468err_remove_input: 2471err_remove_input:
2469 sony_laptop_remove_input(); 2472 sony_laptop_remove_input();
2470 2473