]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Pull bugfix into test branch
authorLen Brown <len.brown@intel.com>
Wed, 20 Dec 2006 07:52:50 +0000 (02:52 -0500)
committerLen Brown <len.brown@intel.com>
Wed, 20 Dec 2006 07:52:50 +0000 (02:52 -0500)
1  2 
drivers/acpi/Kconfig
drivers/acpi/osl.c
drivers/acpi/pci_root.c
drivers/acpi/processor_core.c

diff --combined drivers/acpi/Kconfig
index b0897a0b206c0200e22554a5638febbf452fe2b3,6382f6477aca8053d3a4f39f7b97d8dd694a53dc..1639998e4d2754ea0819b2f946585b98efb6f429
@@@ -11,7 -11,7 +11,7 @@@ config ACP
        bool "ACPI Support"
        depends on IA64 || X86
        depends on PCI
-       select PM
+       depends on PM
        default y
        ---help---
          Advanced Configuration and Power Interface (ACPI) support for 
@@@ -97,7 -97,6 +97,7 @@@ config ACPI_BATTER
  
  config ACPI_BUTTON
        tristate "Button"
 +      depends on INPUT
        default y
        help
          This driver handles events on the power, sleep and lid buttons.
@@@ -173,7 -172,6 +173,7 @@@ config ACPI_NUM
  config ACPI_ASUS
          tristate "ASUS/Medion Laptop Extras"
        depends on X86
 +      select BACKLIGHT_CLASS_DEVICE
          ---help---
            This driver provides support for extra features of ACPI-compatible
            ASUS laptops. As some of Medion laptops are made by ASUS, it may also
  config ACPI_IBM
        tristate "IBM ThinkPad Laptop Extras"
        depends on X86
 +      select BACKLIGHT_CLASS_DEVICE
        ---help---
          This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds
          support for Fn-Fx key combinations, Bluetooth control, video
@@@ -225,21 -222,9 +225,21 @@@ config ACPI_IBM_DOC
  
          If you are not sure, say N here.
  
 +config ACPI_IBM_BAY
 +      bool "Legacy Removable Bay Support"
 +      depends on ACPI_IBM
 +      depends on ACPI_BAY=n
 +      default n
 +      ---help---
 +        Allows the ibm_acpi driver to handle removable bays.
 +        This support is obsoleted by CONFIG_ACPI_BAY.
 +
 +        If you are not sure, say N here.
 +
  config ACPI_TOSHIBA
        tristate "Toshiba Laptop Extras"
        depends on X86
 +      select BACKLIGHT_CLASS_DEVICE
        ---help---
          This driver adds support for access to certain system settings
          on "legacy free" Toshiba laptops.  These laptops can be recognized by
diff --combined drivers/acpi/osl.c
index b7ca020a0565a772de31449b073a13b53cc48369,e10679ce1e0eb090ccc3e3e896f129ce931d5108..57ae1e5cde0a2400f8f060d88d7024dd89ba6ba1
@@@ -50,7 -50,6 +50,7 @@@ ACPI_MODULE_NAME("osl"
  struct acpi_os_dpc {
        acpi_osd_exec_callback function;
        void *context;
 +      struct work_struct work;
  };
  
  #ifdef CONFIG_ACPI_CUSTOM_DSDT
@@@ -74,6 -73,7 +74,6 @@@ static unsigned int acpi_irq_irq
  static acpi_osd_handler acpi_irq_handler;
  static void *acpi_irq_context;
  static struct workqueue_struct *kacpid_wq;
 -static struct workqueue_struct *kacpi_notify_wq;
  
  acpi_status acpi_os_initialize(void)
  {
@@@ -92,8 -92,9 +92,8 @@@ acpi_status acpi_os_initialize1(void
                return AE_NULL_ENTRY;
        }
        kacpid_wq = create_singlethread_workqueue("kacpid");
 -      kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify");
        BUG_ON(!kacpid_wq);
 -      BUG_ON(!kacpi_notify_wq);
 +
        return AE_OK;
  }
  
@@@ -105,6 -106,7 +105,6 @@@ acpi_status acpi_os_terminate(void
        }
  
        destroy_workqueue(kacpid_wq);
 -      destroy_workqueue(kacpi_notify_wq);
  
        return AE_OK;
  }
@@@ -565,10 -567,9 +565,10 @@@ void acpi_os_derive_pci_id(acpi_handle 
        acpi_os_derive_pci_id_2(rhandle, chandle, id, &is_bridge, &bus_number);
  }
  
 -static void acpi_os_execute_deferred(void *context)
 +static void acpi_os_execute_deferred(struct work_struct *work)
  {
 -      struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context;
 +      struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
 +
        if (!dpc) {
                printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
                return;
@@@ -601,41 -602,40 +601,41 @@@ acpi_status acpi_os_execute(acpi_execut
  {
        acpi_status status = AE_OK;
        struct acpi_os_dpc *dpc;
 -      struct work_struct *task;
 +
 +      ACPI_FUNCTION_TRACE("os_queue_for_execution");
  
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
                          "Scheduling function [%p(%p)] for deferred execution.\n",
                          function, context));
  
        if (!function)
 -              return AE_BAD_PARAMETER;
 +              return_ACPI_STATUS(AE_BAD_PARAMETER);
  
        /*
         * Allocate/initialize DPC structure.  Note that this memory will be
 -       * freed by the callee.  The kernel handles the tq_struct list  in a
 +       * freed by the callee.  The kernel handles the work_struct list  in a
         * way that allows us to also free its memory inside the callee.
         * Because we may want to schedule several tasks with different
         * parameters we can't use the approach some kernel code uses of
 -       * having a static tq_struct.
 -       * We can save time and code by allocating the DPC and tq_structs
 -       * from the same memory.
 +       * having a static work_struct.
         */
  
 -      dpc = kmalloc(sizeof(struct acpi_os_dpc) +
 -                      sizeof(struct work_struct), GFP_ATOMIC);
 +      dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_ATOMIC);
        if (!dpc)
 -              return AE_NO_MEMORY;
 +              return_ACPI_STATUS(AE_NO_MEMORY);
 +
        dpc->function = function;
        dpc->context = context;
 -      task = (void *)(dpc + 1);
 -      INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
 -      if (!queue_work((type == OSL_NOTIFY_HANDLER)?
 -                      kacpi_notify_wq : kacpid_wq, task)) {
 -              status = AE_ERROR;
 +
 +      INIT_WORK(&dpc->work, acpi_os_execute_deferred);
 +      if (!queue_work(kacpid_wq, &dpc->work)) {
 +              ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
 +                                "Call to queue_work() failed.\n"));
                kfree(dpc);
 +              status = AE_ERROR;
        }
 -      return status;
 +
 +      return_ACPI_STATUS(status);
  }
  
  EXPORT_SYMBOL(acpi_os_execute);
@@@ -1032,7 -1032,7 +1032,7 @@@ acpi_statu
  acpi_os_create_cache(char *name, u16 size, u16 depth, acpi_cache_t ** cache)
  {
        *cache = kmem_cache_create(name, size, 0, 0, NULL, NULL);
-       if (cache == NULL)
+       if (*cache == NULL)
                return AE_ERROR;
        else
                return AE_OK;
  
  acpi_status acpi_os_purge_cache(acpi_cache_t * cache)
  {
 -      (void)kmem_cache_shrink(cache);
 +      kmem_cache_shrink(cache);
        return (AE_OK);
  }
  
diff --combined drivers/acpi/pci_root.c
index 03e03741c1404309d0888258ec1ec34253b7d141,c92c144d6c58d54bd0bc91567939aa6fd03cc4d0..b9c52cdbf6587bc641026b123cb0d82625b42493
@@@ -98,11 -98,12 +98,12 @@@ void acpi_pci_unregister_driver(struct 
  
        struct acpi_pci_driver **pptr = &sub_driver;
        while (*pptr) {
-               if (*pptr != driver)
-                       continue;
-               *pptr = (*pptr)->next;
-               break;
+               if (*pptr == driver)
+                       break;
+               pptr = &(*pptr)->next;
        }
+       BUG_ON(!*pptr);
+       *pptr = (*pptr)->next;
  
        if (!driver->remove)
                return;
@@@ -119,7 -120,7 +120,7 @@@ EXPORT_SYMBOL(acpi_pci_unregister_drive
  static acpi_status
  get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
  {
 -      int *busnr = (int *)data;
 +      int *busnr = data;
        struct acpi_resource_address64 address;
  
        if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 &&
@@@ -331,7 -332,7 +332,7 @@@ static int acpi_pci_root_remove(struct 
        if (!device || !acpi_driver_data(device))
                return -EINVAL;
  
 -      root = (struct acpi_pci_root *)acpi_driver_data(device);
 +      root = acpi_driver_data(device);
  
        kfree(root);
  
index 3e70a08e4a8b8cdbf09fb5eae66c920ae221a39e,22eb05efa64c64c9f4ff8c1981e91cf6a955c3db..89b3610feb47b6ea3f9317926cc6921b477b3440
@@@ -277,7 -277,7 +277,7 @@@ static struct proc_dir_entry *acpi_proc
  
  static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
  {
 -      struct acpi_processor *pr = (struct acpi_processor *)seq->private;
 +      struct acpi_processor *pr = seq->private;
  
  
        if (!pr)
@@@ -542,12 -542,12 +542,12 @@@ static int __cpuinit acpi_processor_sta
         * Don't trust it blindly
         */
        if (processor_device_array[pr->id] != NULL &&
 -          processor_device_array[pr->id] != (void *)device) {
 +          processor_device_array[pr->id] != device) {
                printk(KERN_WARNING "BIOS reported wrong ACPI id"
                        "for the processor\n");
                return -ENODEV;
        }
 -      processor_device_array[pr->id] = (void *)device;
 +      processor_device_array[pr->id] = device;
  
        processors[pr->id] = pr;
  
  
  static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
  {
 -      struct acpi_processor *pr = (struct acpi_processor *)data;
 +      struct acpi_processor *pr = data;
        struct acpi_device *device = NULL;
  
  
@@@ -637,7 -637,7 +637,7 @@@ static int acpi_processor_remove(struc
        if (!device || !acpi_driver_data(device))
                return -EINVAL;
  
 -      pr = (struct acpi_processor *)acpi_driver_data(device);
 +      pr = acpi_driver_data(device);
  
        if (pr->id >= NR_CPUS) {
                kfree(pr);
@@@ -901,13 -901,13 +901,13 @@@ static int __init acpi_processor_init(v
  
        acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
        if (!acpi_processor_dir)
-               return 0;
+               return -ENOMEM;
        acpi_processor_dir->owner = THIS_MODULE;
  
        result = acpi_bus_register_driver(&acpi_processor_driver);
        if (result < 0) {
                remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
-               return 0;
+               return result;
        }
  
        acpi_processor_install_hotplug_notify();