[2.6.22.y] {09/17} - sony-laptop-call-sonypi_compat_init-earlier - series for stable kernel

From: Oliver Pinter (Pintér Olivér)
Date: Mon Jan 28 2008 - 18:18:06 EST


--
Thanks,
Oliver
commit e818e2bd96d1280db79c9383b07013b42515eded
Author: Mattia Dongili <malattia@xxxxxxxx>
Date: Sun Aug 12 07:20:27 2007 +0900

Subject: sony-laptop: call sonypi_compat_init earlier
Patch-mainline: 2.6.23
References: 350984

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@xxxxxxxx>
Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
Acked-by: Jeff Mahoney <jeffm@xxxxxxxx>

diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index ab2ca63..6d2d64f 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -2056,8 +2056,6 @@ static int sony_pic_remove(struct acpi_device *device, int type)
struct sony_pic_ioport *io, *tmp_io;
struct sony_pic_irq *irq, *tmp_irq;

- sonypi_compat_exit();
-
if (sony_pic_disable(device)) {
printk(KERN_ERR DRV_PFX "Couldn't disable device.\n");
return -ENXIO;
@@ -2067,6 +2065,8 @@ static int sony_pic_remove(struct acpi_device *device, int type)
release_region(spic_dev.cur_ioport->io.minimum,
spic_dev.cur_ioport->io.address_length);

+ sonypi_compat_exit();
+
sony_laptop_remove_input();

/* pf attrs */
@@ -2132,6 +2132,9 @@ static int sony_pic_add(struct acpi_device *device)
goto err_free_resources;
}

+ if (sonypi_compat_init())
+ goto err_remove_input;
+
/* request io port */
list_for_each_entry(io, &spic_dev.ioports, list) {
if (request_region(io->io.minimum, io->io.address_length,
@@ -2146,7 +2149,7 @@ static int sony_pic_add(struct acpi_device *device)
if (!spic_dev.cur_ioport) {
printk(KERN_ERR DRV_PFX "Failed to request_region.\n");
result = -ENODEV;
- goto err_remove_input;
+ goto err_remove_compat;
}

/* request IRQ */
@@ -2186,9 +2189,6 @@ static int sony_pic_add(struct acpi_device *device)
if (result)
goto err_remove_pf;

- if (sonypi_compat_init())
- goto err_remove_pf;
-
return 0;

err_remove_pf:
@@ -2204,6 +2204,9 @@ err_release_region:
release_region(spic_dev.cur_ioport->io.minimum,
spic_dev.cur_ioport->io.address_length);

+err_remove_compat:
+ sonypi_compat_exit();
+
err_remove_input:
sony_laptop_remove_input();