]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ACPI: SBS: Host controller must initialize before SBS.
authorAlexey Starikovskiy <astarikovskiy@suse.de>
Sat, 9 Feb 2008 08:22:13 +0000 (03:22 -0500)
committerLen Brown <len.brown@intel.com>
Sat, 9 Feb 2008 08:22:13 +0000 (03:22 -0500)
In static case sbshc must be compiled ahead of sbs, so that
hc is configured first.

http://bugzilla.kernel.org/show_bug.cgi?id=9910

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/Makefile
drivers/acpi/sbs.c
drivers/acpi/sbshc.c

index f29812a86533778a28b211b5c601bcf4863fadc9..40b0fcae4c78a71ac083119c96f6396e6e3bab07 100644 (file)
@@ -60,5 +60,5 @@ obj-$(CONFIG_ACPI_ASUS)               += asus_acpi.o
 obj-$(CONFIG_ACPI_TOSHIBA)     += toshiba_acpi.o
 obj-$(CONFIG_ACPI_HOTPLUG_MEMORY)      += acpi_memhotplug.o
 obj-$(CONFIG_ACPI_PROCFS_POWER)        += cm_sbs.o
-obj-$(CONFIG_ACPI_SBS)         += sbs.o
 obj-$(CONFIG_ACPI_SBS)         += sbshc.o
+obj-$(CONFIG_ACPI_SBS)         += sbs.o
index 1194105cc3cad977c5472a528ba8a261a870d2a8..585ae3c9c8ea98651e33f46de53876fac237f48d 100644 (file)
@@ -827,7 +827,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
 #endif
        printk(KERN_INFO PREFIX "%s [%s]: Battery Slot [%s] (battery %s)\n",
               ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
-              battery->name, sbs->battery->present ? "present" : "absent");
+              battery->name, battery->present ? "present" : "absent");
        return result;
 }
 
index ae9a90438e2f32f497e207889bf4677c431c3383..a2cf3008ce6c03eb40ad564d3063700896a68d03 100644 (file)
@@ -117,6 +117,11 @@ static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol,
        int ret = -EFAULT, i;
        u8 temp, sz = 0;
 
+       if (!hc) {
+               printk(KERN_ERR PREFIX "host controller is not configured\n");
+               return ret;
+       }
+
        mutex_lock(&hc->lock);
        if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp))
                goto end;
@@ -292,6 +297,7 @@ static int acpi_smbus_hc_remove(struct acpi_device *device, int type)
        hc = acpi_driver_data(device);
        acpi_ec_remove_query_handler(hc->ec, hc->query_bit);
        kfree(hc);
+       acpi_driver_data(device) = NULL;
        return 0;
 }