]> Pileus Git - ~andy/linux/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 21 Apr 2008 22:49:58 +0000 (15:49 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 21 Apr 2008 22:49:58 +0000 (15:49 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
  SCSI: convert struct class_device to struct device
  DRM: remove unused dev_class
  IB: rename "dev" to "srp_dev" in srp_host structure
  IB: convert struct class_device to struct device
  memstick: convert struct class_device to struct device
  driver core: replace remaining __FUNCTION__ occurrences
  sysfs: refill attribute buffer when reading from offset 0
  PM: Remove destroy_suspended_device()
  Firmware: add iSCSI iBFT Support
  PM: Remove legacy PM (fix)
  Kobject: Replace list_for_each() with list_for_each_entry().
  SYSFS: Explicitly include required header file slab.h.
  Driver core: make device_is_registered() work for class devices
  PM: Convert wakeup flag accessors to inline functions
  PM: Make wakeup flags available whenever CONFIG_PM is set
  PM: Fix misuse of wakeup flag accessors in serial core
  Driver core: Call device_pm_add() after bus_add_device() in device_add()
  PM: Handle device registrations during suspend/resume
  block: send disk "change" event for rescan_partitions()
  sysdev: detect multiple driver registrations
  ...

Fixed trivial conflict in include/linux/memory.h due to semaphore header
file change (made irrelevant by the change to mutex).

1  2 
MAINTAINERS
arch/arm/Kconfig
arch/x86/kernel/setup_32.c
arch/x86/kernel/setup_64.c
drivers/base/core.c
drivers/base/cpu.c
drivers/infiniband/core/user_mad.c
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/linit.c
include/linux/device.h

diff --combined MAINTAINERS
index 2b67bb05718000a26bda1a62251c7cf3382626d6,897e5ebb2ab7a4c7c03e00012a9fb6e9a7a76751..a46ec689f0ac1e14b46301aa66afb4501842bb4b
@@@ -486,12 -486,6 +486,12 @@@ M:       kernel@wantstofly.or
  L:    linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
  S:    Maintained
  
 +ARM/GUMSTIX MACHINE SUPPORT
 +P:    Steve Sakoman
 +M:    sakoman@gmail.com
 +L:    linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
 +S:    Maintained
 +
  ARM/HP JORNADA 7XX MACHINE SUPPORT
  P:      Kristoffer Ericson
  M:      kristoffer.ericson@gmail.com
@@@ -3610,6 -3604,11 +3610,11 @@@ M:    mhoffman@lightlink.co
  L:    lm-sensors@lm-sensors.org
  S:    Maintained
  
+ SMX UIO Interface
+ P:    Ben Nizette
+ M:    bn@niasdigital.com
+ S:    Maintained
  SOFTWARE RAID (Multiple Disks) SUPPORT
  P:    Ingo Molnar
  M:    mingo@redhat.com
diff --combined arch/arm/Kconfig
index a34cc03e727f2a65db7a6a8d8b4c504c578235bb,1165a8fb99c138cb335a38092af8cf6230d172ea..d8d253285a94a33c8cc80607b8e811403563e78b
@@@ -255,7 -255,6 +255,7 @@@ config ARCH_EP93X
        select ARM_AMBA
        select ARM_VIC
        select GENERIC_GPIO
 +      select HAVE_GPIO_LIB
        help
          This enables support for the Cirrus EP93xx series of CPUs.
  
@@@ -378,17 -377,15 +378,17 @@@ config ARCH_MX
        help
          Support for Freescale MXC/iMX-based family of processors
  
 -config ARCH_ORION
 +config ARCH_ORION5X
        bool "Marvell Orion"
        depends on MMU
        select PCI
        select GENERIC_GPIO
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
 +      select PLAT_ORION
        help
 -        Support for Marvell Orion System on Chip family.
 +        Support for the following Marvell Orion 5x series SoCs:
 +        Orion-1 (5181), Orion-NAS (5182), Orion-2 (5281.)
  
  config ARCH_PNX4008
        bool "Philips Nexperia PNX4008 Mobile"
@@@ -425,15 -422,10 +425,15 @@@ config ARCH_SA110
        bool "SA1100-based"
        select ISA
        select ARCH_DISCONTIGMEM_ENABLE
 +      select ARCH_SPARSEMEM_ENABLE
 +      select ARCH_SELECT_MEMORY_MODEL
        select ARCH_MTD_XIP
        select GENERIC_GPIO
        select GENERIC_TIME
 +      select GENERIC_CLOCKEVENTS
 +      select TICK_ONESHOT
        select HAVE_IDE
 +      select HAVE_GPIO_LIB
        help
          Support for StrongARM 11x0 based boards.
  
@@@ -476,7 -468,6 +476,7 @@@ config ARCH_DAVINC
  config ARCH_OMAP
        bool "TI OMAP"
        select GENERIC_GPIO
 +      select HAVE_GPIO_LIB
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        help
@@@ -525,7 -516,7 +525,7 @@@ source "arch/arm/mach-omap1/Kconfig
  
  source "arch/arm/mach-omap2/Kconfig"
  
 -source "arch/arm/mach-orion/Kconfig"
 +source "arch/arm/mach-orion5x/Kconfig"
  
  source "arch/arm/plat-s3c24xx/Kconfig"
  source "arch/arm/plat-s3c/Kconfig"
@@@ -572,9 -563,6 +572,9 @@@ config ARCH_ACOR
  config PLAT_IOP
        bool
  
 +config PLAT_ORION
 +      bool
 +
  source arch/arm/mm/Kconfig
  
  config IWMMXT
@@@ -662,7 -650,7 +662,7 @@@ source "kernel/time/Kconfig
  
  config SMP
        bool "Symmetric Multi-Processing (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL && REALVIEW_EB_ARM11MP
 +      depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP)
        help
          This enables support for systems with more than one CPU. If you have
          a system with only one CPU, like most personal computers, say N. If
@@@ -695,7 -683,7 +695,7 @@@ config HOTPLUG_CP
  
  config LOCAL_TIMERS
        bool "Use local timer interrupts"
 -      depends on SMP && REALVIEW_EB_ARM11MP
 +      depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP)
        default y
        help
          Enable support for local timers on SMP platforms, rather then the
@@@ -786,12 -774,6 +786,12 @@@ config ARCH_DISCONTIGMEM_ENABL
          or have huge holes in the physical address space for other reasons.
          See <file:Documentation/vm/numa> for more.
  
 +config ARCH_SPARSEMEM_ENABLE
 +      bool
 +
 +config ARCH_SELECT_MEMORY_MODEL
 +      bool
 +
  config NODES_SHIFT
        int
        default "4" if ARCH_LH7A40X
@@@ -1192,6 -1174,8 +1192,8 @@@ source "drivers/dma/Kconfig
  
  source "drivers/dca/Kconfig"
  
+ source "drivers/uio/Kconfig"
  endmenu
  
  source "fs/Kconfig"
index 1c4799e687183f231f9a1c8c3248148bcc4aceae,4ef91749959ef239f6bbf419a62aee92e9643b5b..78828b0f604fb387f1e847ae16f35272d51cb44a
@@@ -39,6 -39,7 +39,7 @@@
  #include <linux/efi.h>
  #include <linux/init.h>
  #include <linux/edd.h>
+ #include <linux/iscsi_ibft.h>
  #include <linux/nodemask.h>
  #include <linux/kexec.h>
  #include <linux/crash_dump.h>
@@@ -689,6 -690,8 +690,8 @@@ void __init setup_bootmem_allocator(voi
  #endif
        numa_kva_reserve();
        reserve_crashkernel();
+       reserve_ibft_region();
  }
  
  /*
@@@ -812,10 -815,10 +815,10 @@@ void __init setup_arch(char **cmdline_p
                efi_init();
  
        /* update e820 for memory not covered by WB MTRRs */
 -      find_max_pfn();
 +      propagate_e820_map();
        mtrr_bp_init();
        if (mtrr_trim_uncached_memory(max_pfn))
 -              find_max_pfn();
 +              propagate_e820_map();
  
        max_low_pfn = setup_memory();
  
index 6b8e11f0c15d79c699dec0bea0df7c73e2759c8e,216c93bd9993af70ead09aaa155d865a428f907e..c2ec3dcb6b991304633ed138098e974fc9ff3ff5
@@@ -33,6 -33,7 +33,7 @@@
  #include <linux/acpi.h>
  #include <linux/kallsyms.h>
  #include <linux/edd.h>
+ #include <linux/iscsi_ibft.h>
  #include <linux/mmzone.h>
  #include <linux/kexec.h>
  #include <linux/cpufreq.h>
@@@ -398,8 -399,6 +399,8 @@@ void __init setup_arch(char **cmdline_p
  
        early_res_to_bootmem();
  
 +      dma32_reserve_bootmem();
 +
  #ifdef CONFIG_ACPI_SLEEP
        /*
         * Reserve low memory region for sleep support.
                unsigned long end_of_mem    = end_pfn << PAGE_SHIFT;
  
                if (ramdisk_end <= end_of_mem) {
 -                      reserve_bootmem_generic(ramdisk_image, ramdisk_size);
 +                      /*
 +                       * don't need to reserve again, already reserved early
 +                       * in x86_64_start_kernel, and early_res_to_bootmem
 +                       * convert that to reserved in bootmem
 +                       */
                        initrd_start = ramdisk_image + PAGE_OFFSET;
                        initrd_end = initrd_start+ramdisk_size;
                } else {
 -                      /* Assumes everything on node 0 */
                        free_bootmem(ramdisk_image, ramdisk_size);
                        printk(KERN_ERR "initrd extends beyond end of memory "
                               "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
        }
  #endif
        reserve_crashkernel();
+       reserve_ibft_region();
        paging_init();
        map_vsyscall();
  
diff --combined drivers/base/core.c
index 7c4b36ccb1a0fa8677a600b4591139ed314f7edd,0737fe5392a36c6e2291b3040dfd876c2f78bbcc..9248e0927d0873062800a4fd10ee2746bb956c34
@@@ -20,7 -20,7 +20,7 @@@
  #include <linux/notifier.h>
  #include <linux/genhd.h>
  #include <linux/kallsyms.h>
 -#include <asm/semaphore.h>
 +#include <linux/semaphore.h>
  
  #include "base.h"
  #include "power/power.h"
@@@ -207,7 -207,7 +207,7 @@@ static int dev_uevent(struct kset *kset
                retval = dev->bus->uevent(dev, env);
                if (retval)
                        pr_debug("device: '%s': %s: bus uevent() returned %d\n",
-                                dev->bus_id, __FUNCTION__, retval);
+                                dev->bus_id, __func__, retval);
        }
  
        /* have the class specific function add its stuff */
                if (retval)
                        pr_debug("device: '%s': %s: class uevent() "
                                 "returned %d\n", dev->bus_id,
-                                __FUNCTION__, retval);
+                                __func__, retval);
        }
  
        /* have the device type specific fuction add its stuff */
                if (retval)
                        pr_debug("device: '%s': %s: dev_type uevent() "
                                 "returned %d\n", dev->bus_id,
-                                __FUNCTION__, retval);
+                                __func__, retval);
        }
  
        return retval;
@@@ -782,7 -782,7 +782,7 @@@ int device_add(struct device *dev
                goto Done;
        }
  
-       pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
+       pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
  
        parent = get_device(dev->parent);
        setup_parent(dev, parent);
        error = device_add_attrs(dev);
        if (error)
                goto AttrsError;
-       error = dpm_sysfs_add(dev);
-       if (error)
-               goto PMError;
-       device_pm_add(dev);
        error = bus_add_device(dev);
        if (error)
                goto BusError;
+       error = device_pm_add(dev);
+       if (error)
+               goto PMError;
        kobject_uevent(&dev->kobj, KOBJ_ADD);
        bus_attach_device(dev);
        if (parent)
   Done:
        put_device(dev);
        return error;
-  BusError:
-       device_pm_remove(dev);
   PMError:
+       bus_remove_device(dev);
+  BusError:
        if (dev->bus)
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
                                             BUS_NOTIFY_DEL_DEVICE, dev);
@@@ -981,7 -980,7 +980,7 @@@ void device_del(struct device *dev
   */
  void device_unregister(struct device *dev)
  {
-       pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
+       pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
        device_del(dev);
        put_device(dev);
  }
@@@ -1076,7 -1075,7 +1075,7 @@@ EXPORT_SYMBOL_GPL(device_remove_file)
  
  static void device_create_release(struct device *dev)
  {
-       pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
+       pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
        kfree(dev);
  }
  
@@@ -1164,35 -1163,6 +1163,6 @@@ void device_destroy(struct class *class
  }
  EXPORT_SYMBOL_GPL(device_destroy);
  
- #ifdef CONFIG_PM_SLEEP
- /**
-  * destroy_suspended_device - asks the PM core to remove a suspended device
-  * @class: pointer to the struct class that this device was registered with
-  * @devt: the dev_t of the device that was previously registered
-  *
-  * This call notifies the PM core of the necessity to unregister a suspended
-  * device created with a call to device_create() (devices cannot be
-  * unregistered directly while suspended, since the PM core holds their
-  * semaphores at that time).
-  *
-  * It can only be called within the scope of a system sleep transition.  In
-  * practice this means it has to be directly or indirectly invoked either by
-  * a suspend or resume method, or by the PM core (e.g. via
-  * disable_nonboot_cpus() or enable_nonboot_cpus()).
-  */
- void destroy_suspended_device(struct class *class, dev_t devt)
- {
-       struct device *dev;
-       dev = class_find_device(class, &devt, __match_devt);
-       if (dev) {
-               device_pm_schedule_removal(dev);
-               put_device(dev);
-       }
- }
- EXPORT_SYMBOL_GPL(destroy_suspended_device);
- #endif /* CONFIG_PM_SLEEP */
  /**
   * device_rename - renames a device
   * @dev: the pointer to the struct device to be renamed
@@@ -1210,7 -1180,7 +1180,7 @@@ int device_rename(struct device *dev, c
                return -EINVAL;
  
        pr_debug("device: '%s': %s: renaming to '%s'\n", dev->bus_id,
-                __FUNCTION__, new_name);
+                __func__, new_name);
  
  #ifdef CONFIG_SYSFS_DEPRECATED
        if ((dev->class) && (dev->parent))
                                          dev->bus_id);
                if (error) {
                        dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n",
-                               __FUNCTION__, error);
+                               __func__, error);
                }
        }
  #endif
@@@ -1325,7 -1295,7 +1295,7 @@@ int device_move(struct device *dev, str
        new_parent_kobj = get_device_parent(dev, new_parent);
  
        pr_debug("device: '%s': %s: moving to '%s'\n", dev->bus_id,
-                __FUNCTION__, new_parent ? new_parent->bus_id : "<NULL>");
+                __func__, new_parent ? new_parent->bus_id : "<NULL>");
        error = kobject_move(&dev->kobj, new_parent_kobj);
        if (error) {
                cleanup_glue_dir(dev, new_parent_kobj);
diff --combined drivers/base/cpu.c
index 2c76afff3b15060e723fcec52569e450a3c46265,3e417a97681d460ebed67e0f839efffedc0c24ff..6fe417429977058b40f9ac2caee0b5b933078070
@@@ -28,7 -28,7 +28,7 @@@ static ssize_t show_online(struct sys_d
        return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id));
  }
  
- static ssize_t store_online(struct sys_device *dev, const char *buf,
+ static ssize_t __ref store_online(struct sys_device *dev, const char *buf,
                            size_t count)
  {
        struct cpu *cpu = container_of(dev, struct cpu, sysdev);
@@@ -55,7 -55,7 +55,7 @@@
  }
  static SYSDEV_ATTR(online, 0644, show_online, store_online);
  
- static void __devinit register_cpu_control(struct cpu *cpu)
+ static void __cpuinit register_cpu_control(struct cpu *cpu)
  {
        sysdev_create_file(&cpu->sysdev, &attr_online);
  }
@@@ -102,51 -102,6 +102,51 @@@ static ssize_t show_crash_notes(struct 
  static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL);
  #endif
  
 +/*
 + * Print cpu online, possible, present, and system maps
 + */
 +static ssize_t print_cpus_map(char *buf, cpumask_t *map)
 +{
 +      int n = cpulist_scnprintf(buf, PAGE_SIZE-2, *map);
 +
 +      buf[n++] = '\n';
 +      buf[n] = '\0';
 +      return n;
 +}
 +
 +#define       print_cpus_func(type) \
 +static ssize_t print_cpus_##type(struct sysdev_class *class, char *buf)       \
 +{                                                                     \
 +      return print_cpus_map(buf, &cpu_##type##_map);                  \
 +}                                                                     \
 +struct sysdev_class_attribute attr_##type##_map =                     \
 +      _SYSDEV_CLASS_ATTR(type, 0444, print_cpus_##type, NULL)
 +
 +print_cpus_func(online);
 +print_cpus_func(possible);
 +print_cpus_func(present);
 +
 +struct sysdev_class_attribute *cpu_state_attr[] = {
 +      &attr_online_map,
 +      &attr_possible_map,
 +      &attr_present_map,
 +};
 +
 +static int cpu_states_init(void)
 +{
 +      int i;
 +      int err = 0;
 +
 +      for (i = 0;  i < ARRAY_SIZE(cpu_state_attr); i++) {
 +              int ret;
 +              ret = sysdev_class_create_file(&cpu_sysdev_class,
 +                                              cpu_state_attr[i]);
 +              if (!err)
 +                      err = ret;
 +      }
 +      return err;
 +}
 +
  /*
   * register_cpu - Setup a sysfs device for a CPU.
   * @cpu - cpu->hotpluggable field set to 1 will generate a control file in
@@@ -192,9 -147,6 +192,9 @@@ int __init cpu_dev_init(void
        int err;
  
        err = sysdev_class_register(&cpu_sysdev_class);
 +      if (!err)
 +              err = cpu_states_init();
 +
  #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT)
        if (!err)
                err = sched_create_sysfs_power_savings_entries(&cpu_sysdev_class);
index be953e87bf93f77fed7afc3bbb64262b9d3998c3,9a9d3446c6edb0710540c6df6010c049c9bbe088..3aa2db54eae4058266919049b848238aa59e4a87
@@@ -46,9 -46,9 +46,9 @@@
  #include <linux/mutex.h>
  #include <linux/kref.h>
  #include <linux/compat.h>
 +#include <linux/semaphore.h>
  
  #include <asm/uaccess.h>
 -#include <asm/semaphore.h>
  
  #include <rdma/ib_mad.h>
  #include <rdma/ib_user_mad.h>
@@@ -88,11 -88,11 +88,11 @@@ enum 
   */
  
  struct ib_umad_port {
-       struct cdev           *dev;
-       struct class_device   *class_dev;
+       struct cdev           *cdev;
+       struct device         *dev;
  
-       struct cdev           *sm_dev;
-       struct class_device   *sm_class_dev;
+       struct cdev           *sm_cdev;
+       struct device         *sm_dev;
        struct semaphore       sm_sem;
  
        struct mutex           file_mutex;
@@@ -948,27 -948,29 +948,29 @@@ static struct ib_client umad_client = 
        .remove = ib_umad_remove_one
  };
  
- static ssize_t show_ibdev(struct class_device *class_dev, char *buf)
+ static ssize_t show_ibdev(struct device *dev, struct device_attribute *attr,
+                         char *buf)
  {
-       struct ib_umad_port *port = class_get_devdata(class_dev);
+       struct ib_umad_port *port = dev_get_drvdata(dev);
  
        if (!port)
                return -ENODEV;
  
        return sprintf(buf, "%s\n", port->ib_dev->name);
  }
- static CLASS_DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
+ static DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
  
- static ssize_t show_port(struct class_device *class_dev, char *buf)
+ static ssize_t show_port(struct device *dev, struct device_attribute *attr,
+                        char *buf)
  {
-       struct ib_umad_port *port = class_get_devdata(class_dev);
+       struct ib_umad_port *port = dev_get_drvdata(dev);
  
        if (!port)
                return -ENODEV;
  
        return sprintf(buf, "%d\n", port->port_num);
  }
- static CLASS_DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
+ static DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
  
  static ssize_t show_abi_version(struct class *class, char *buf)
  {
@@@ -994,48 -996,47 +996,47 @@@ static int ib_umad_init_port(struct ib_
        mutex_init(&port->file_mutex);
        INIT_LIST_HEAD(&port->file_list);
  
-       port->dev = cdev_alloc();
-       if (!port->dev)
+       port->cdev = cdev_alloc();
+       if (!port->cdev)
                return -1;
-       port->dev->owner = THIS_MODULE;
-       port->dev->ops   = &umad_fops;
-       kobject_set_name(&port->dev->kobj, "umad%d", port->dev_num);
-       if (cdev_add(port->dev, base_dev + port->dev_num, 1))
+       port->cdev->owner = THIS_MODULE;
+       port->cdev->ops   = &umad_fops;
+       kobject_set_name(&port->cdev->kobj, "umad%d", port->dev_num);
+       if (cdev_add(port->cdev, base_dev + port->dev_num, 1))
                goto err_cdev;
  
-       port->class_dev = class_device_create(umad_class, NULL, port->dev->dev,
-                                             device->dma_device,
-                                             "umad%d", port->dev_num);
-       if (IS_ERR(port->class_dev))
+       port->dev = device_create(umad_class, device->dma_device,
+                                 port->cdev->dev, "umad%d", port->dev_num);
+       if (IS_ERR(port->dev))
                goto err_cdev;
  
-       if (class_device_create_file(port->class_dev, &class_device_attr_ibdev))
-               goto err_class;
-       if (class_device_create_file(port->class_dev, &class_device_attr_port))
-               goto err_class;
-       port->sm_dev = cdev_alloc();
-       if (!port->sm_dev)
-               goto err_class;
-       port->sm_dev->owner = THIS_MODULE;
-       port->sm_dev->ops   = &umad_sm_fops;
-       kobject_set_name(&port->sm_dev->kobj, "issm%d", port->dev_num);
-       if (cdev_add(port->sm_dev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))
+       if (device_create_file(port->dev, &dev_attr_ibdev))
+               goto err_dev;
+       if (device_create_file(port->dev, &dev_attr_port))
+               goto err_dev;
+       port->sm_cdev = cdev_alloc();
+       if (!port->sm_cdev)
+               goto err_dev;
+       port->sm_cdev->owner = THIS_MODULE;
+       port->sm_cdev->ops   = &umad_sm_fops;
+       kobject_set_name(&port->sm_cdev->kobj, "issm%d", port->dev_num);
+       if (cdev_add(port->sm_cdev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))
                goto err_sm_cdev;
  
-       port->sm_class_dev = class_device_create(umad_class, NULL, port->sm_dev->dev,
-                                                device->dma_device,
-                                                "issm%d", port->dev_num);
-       if (IS_ERR(port->sm_class_dev))
+       port->sm_dev = device_create(umad_class, device->dma_device,
+                                    port->sm_cdev->dev,
+                                    "issm%d", port->dev_num);
+       if (IS_ERR(port->sm_dev))
                goto err_sm_cdev;
  
-       class_set_devdata(port->class_dev,    port);
-       class_set_devdata(port->sm_class_dev, port);
+       dev_set_drvdata(port->dev,    port);
+       dev_set_drvdata(port->sm_dev, port);
  
-       if (class_device_create_file(port->sm_class_dev, &class_device_attr_ibdev))
-               goto err_sm_class;
-       if (class_device_create_file(port->sm_class_dev, &class_device_attr_port))
-               goto err_sm_class;
+       if (device_create_file(port->sm_dev, &dev_attr_ibdev))
+               goto err_sm_dev;
+       if (device_create_file(port->sm_dev, &dev_attr_port))
+               goto err_sm_dev;
  
        spin_lock(&port_lock);
        umad_port[port->dev_num] = port;
  
        return 0;
  
- err_sm_class:
-       class_device_destroy(umad_class, port->sm_dev->dev);
+ err_sm_dev:
+       device_destroy(umad_class, port->sm_cdev->dev);
  
  err_sm_cdev:
-       cdev_del(port->sm_dev);
+       cdev_del(port->sm_cdev);
  
- err_class:
-       class_device_destroy(umad_class, port->dev->dev);
+ err_dev:
+       device_destroy(umad_class, port->cdev->dev);
  
  err_cdev:
-       cdev_del(port->dev);
+       cdev_del(port->cdev);
        clear_bit(port->dev_num, dev_map);
  
        return -1;
@@@ -1065,14 -1066,14 +1066,14 @@@ static void ib_umad_kill_port(struct ib
        int already_dead;
        int id;
  
-       class_set_devdata(port->class_dev,    NULL);
-       class_set_devdata(port->sm_class_dev, NULL);
+       dev_set_drvdata(port->dev,    NULL);
+       dev_set_drvdata(port->sm_dev, NULL);
  
-       class_device_destroy(umad_class, port->dev->dev);
-       class_device_destroy(umad_class, port->sm_dev->dev);
+       device_destroy(umad_class, port->cdev->dev);
+       device_destroy(umad_class, port->sm_cdev->dev);
  
-       cdev_del(port->dev);
-       cdev_del(port->sm_dev);
+       cdev_del(port->cdev);
+       cdev_del(port->sm_cdev);
  
        spin_lock(&port_lock);
        umad_port[port->dev_num] = NULL;
index f1504beb2788c5bf6212fb52de25b8d0bc43712e,439fd8146657a681125f3be04f5180e71530ed67..460d4024c46c4c8118cb841d7c5107f69ed0ef29
@@@ -31,6 -31,7 +31,6 @@@
  #include <linux/slab.h>
  #include <linux/completion.h>
  #include <linux/blkdev.h>
 -#include <asm/semaphore.h>
  #include <asm/uaccess.h>
  #include <linux/highmem.h> /* For flush_kernel_dcache_page */
  
@@@ -1315,7 -1316,7 +1315,7 @@@ int aac_get_adapter_info(struct aac_dev
                        tmp>>24,(tmp>>16)&0xff,tmp&0xff,
                        le32_to_cpu(dev->adapter_info.biosbuild));
                buffer[0] = '\0';
-               if (aac_show_serial_number(
+               if (aac_get_serial_number(
                  shost_to_class(dev->scsi_host_ptr), buffer))
                        printk(KERN_INFO "%s%d: serial %s",
                          dev->name, dev->id, buffer);
index 8372bf6ed4822a39c3acd97fb81a2c9bdaec7abf,c6391838b2cdf0f96033f495a86fa67f7963a649..c109f63f827940e275c886e462280bca459c0997
@@@ -42,6 -42,7 +42,6 @@@
  #include <linux/syscalls.h>
  #include <linux/delay.h>
  #include <linux/kthread.h>
 -#include <asm/semaphore.h>
  
  #include <scsi/scsi.h>
  #include <scsi/scsi_cmnd.h>
@@@ -754,10 -755,10 +754,10 @@@ static long aac_compat_cfg_ioctl(struc
  }
  #endif
  
- static ssize_t aac_show_model(struct class_device *class_dev,
-               char *buf)
+ static ssize_t aac_show_model(struct device *device,
+                             struct device_attribute *attr, char *buf)
  {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len;
  
        if (dev->supplement_adapter_info.AdapterTypeText[0]) {
        return len;
  }
  
- static ssize_t aac_show_vendor(struct class_device *class_dev,
-               char *buf)
+ static ssize_t aac_show_vendor(struct device *device,
+                              struct device_attribute *attr, char *buf)
  {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len;
  
        if (dev->supplement_adapter_info.AdapterTypeText[0]) {
        return len;
  }
  
- static ssize_t aac_show_flags(struct class_device *class_dev, char *buf)
+ static ssize_t aac_show_flags(struct device *cdev,
+                             struct device_attribute *attr, char *buf)
  {
        int len = 0;
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(cdev)->hostdata;
  
        if (nblank(dprintk(x)))
                len = snprintf(buf, PAGE_SIZE, "dprintk\n");
        return len;
  }
  
- static ssize_t aac_show_kernel_version(struct class_device *class_dev,
-               char *buf)
+ static ssize_t aac_show_kernel_version(struct device *device,
+                                      struct device_attribute *attr,
+                                      char *buf)
  {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len, tmp;
  
        tmp = le32_to_cpu(dev->adapter_info.kernelrev);
        return len;
  }
  
- static ssize_t aac_show_monitor_version(struct class_device *class_dev,
-               char *buf)
+ static ssize_t aac_show_monitor_version(struct device *device,
+                                       struct device_attribute *attr,
+                                       char *buf)
  {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len, tmp;
  
        tmp = le32_to_cpu(dev->adapter_info.monitorrev);
        return len;
  }
  
- static ssize_t aac_show_bios_version(struct class_device *class_dev,
-               char *buf)
+ static ssize_t aac_show_bios_version(struct device *device,
+                                    struct device_attribute *attr,
+                                    char *buf)
  {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len, tmp;
  
        tmp = le32_to_cpu(dev->adapter_info.biosrev);
        return len;
  }
  
- ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf)
+ ssize_t aac_show_serial_number(struct device *device,
+                              struct device_attribute *attr, char *buf)
  {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len = 0;
  
        if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0)
        return len;
  }
  
- static ssize_t aac_show_max_channel(struct class_device *class_dev, char *buf)
+ static ssize_t aac_show_max_channel(struct device *device,
+                                   struct device_attribute *attr, char *buf)
  {
        return snprintf(buf, PAGE_SIZE, "%d\n",
-         class_to_shost(class_dev)->max_channel);
+         class_to_shost(device)->max_channel);
  }
  
- static ssize_t aac_show_max_id(struct class_device *class_dev, char *buf)
+ static ssize_t aac_show_max_id(struct device *device,
+                              struct device_attribute *attr, char *buf)
  {
        return snprintf(buf, PAGE_SIZE, "%d\n",
-         class_to_shost(class_dev)->max_id);
+         class_to_shost(device)->max_id);
  }
  
- static ssize_t aac_store_reset_adapter(struct class_device *class_dev,
-               const char *buf, size_t count)
+ static ssize_t aac_store_reset_adapter(struct device *device,
+                                      struct device_attribute *attr,
+                                      const char *buf, size_t count)
  {
        int retval = -EACCES;
  
        if (!capable(CAP_SYS_ADMIN))
                return retval;
-       retval = aac_reset_adapter((struct aac_dev*)class_to_shost(class_dev)->hostdata, buf[0] == '!');
+       retval = aac_reset_adapter((struct aac_dev*)class_to_shost(device)->hostdata, buf[0] == '!');
        if (retval >= 0)
                retval = count;
        return retval;
  }
  
- static ssize_t aac_show_reset_adapter(struct class_device *class_dev,
-               char *buf)
+ static ssize_t aac_show_reset_adapter(struct device *device,
+                                     struct device_attribute *attr,
+                                     char *buf)
  {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len, tmp;
  
        tmp = aac_adapter_check_health(dev);
        return len;
  }
  
- static struct class_device_attribute aac_model = {
+ static struct device_attribute aac_model = {
        .attr = {
                .name = "model",
                .mode = S_IRUGO,
        },
        .show = aac_show_model,
  };
- static struct class_device_attribute aac_vendor = {
+ static struct device_attribute aac_vendor = {
        .attr = {
                .name = "vendor",
                .mode = S_IRUGO,
        },
        .show = aac_show_vendor,
  };
- static struct class_device_attribute aac_flags = {
+ static struct device_attribute aac_flags = {
        .attr = {
                .name = "flags",
                .mode = S_IRUGO,
        },
        .show = aac_show_flags,
  };
- static struct class_device_attribute aac_kernel_version = {
+ static struct device_attribute aac_kernel_version = {
        .attr = {
                .name = "hba_kernel_version",
                .mode = S_IRUGO,
        },
        .show = aac_show_kernel_version,
  };
- static struct class_device_attribute aac_monitor_version = {
+ static struct device_attribute aac_monitor_version = {
        .attr = {
                .name = "hba_monitor_version",
                .mode = S_IRUGO,
        },
        .show = aac_show_monitor_version,
  };
- static struct class_device_attribute aac_bios_version = {
+ static struct device_attribute aac_bios_version = {
        .attr = {
                .name = "hba_bios_version",
                .mode = S_IRUGO,
        },
        .show = aac_show_bios_version,
  };
- static struct class_device_attribute aac_serial_number = {
+ static struct device_attribute aac_serial_number = {
        .attr = {
                .name = "serial_number",
                .mode = S_IRUGO,
        },
        .show = aac_show_serial_number,
  };
- static struct class_device_attribute aac_max_channel = {
+ static struct device_attribute aac_max_channel = {
        .attr = {
                .name = "max_channel",
                .mode = S_IRUGO,
        },
        .show = aac_show_max_channel,
  };
- static struct class_device_attribute aac_max_id = {
+ static struct device_attribute aac_max_id = {
        .attr = {
                .name = "max_id",
                .mode = S_IRUGO,
        },
        .show = aac_show_max_id,
  };
- static struct class_device_attribute aac_reset = {
+ static struct device_attribute aac_reset = {
        .attr = {
                .name = "reset_host",
                .mode = S_IWUSR|S_IRUGO,
        .show = aac_show_reset_adapter,
  };
  
- static struct class_device_attribute *aac_attrs[] = {
+ static struct device_attribute *aac_attrs[] = {
        &aac_model,
        &aac_vendor,
        &aac_flags,
        NULL
  };
  
+ ssize_t aac_get_serial_number(struct device *device, char *buf)
+ {
+       return aac_show_serial_number(device, &aac_serial_number, buf);
+ }
  
  static const struct file_operations aac_cfg_fops = {
        .owner          = THIS_MODULE,
diff --combined include/linux/device.h
index c79b93e56fa07b7c670d4df8c173cabcba81e21d,dc3429e2eb0f07fe2b8523e0cbaceeb07347a779..1a060265aceae6f31b2875d86f660dc9baaee1ab
@@@ -20,7 -20,7 +20,7 @@@
  #include <linux/types.h>
  #include <linux/module.h>
  #include <linux/pm.h>
 -#include <asm/semaphore.h>
 +#include <linux/semaphore.h>
  #include <asm/atomic.h>
  #include <asm/device.h>
  
@@@ -429,7 -429,6 +429,6 @@@ struct device 
        struct kobject kobj;
        char    bus_id[BUS_ID_SIZE];    /* position on parent bus */
        struct device_type      *type;
-       unsigned                is_registered:1;
        unsigned                uevent_suppress:1;
  
        struct semaphore        sem;    /* semaphore to synchronize calls to
        void    (*release)(struct device *dev);
  };
  
+ /* Get the wakeup routines, which depend on struct device */
+ #include <linux/pm_wakeup.h>
  #ifdef CONFIG_NUMA
  static inline int dev_to_node(struct device *dev)
  {
@@@ -506,7 -508,7 +508,7 @@@ static inline void dev_set_drvdata(stru
  
  static inline int device_is_registered(struct device *dev)
  {
-       return dev->is_registered;
+       return dev->kobj.state_in_sysfs;
  }
  
  void driver_init(void);
@@@ -543,20 -545,6 +545,6 @@@ extern struct device *device_create(str
                                    dev_t devt, const char *fmt, ...)
                                    __attribute__((format(printf, 4, 5)));
  extern void device_destroy(struct class *cls, dev_t devt);
- #ifdef CONFIG_PM_SLEEP
- extern void destroy_suspended_device(struct class *cls, dev_t devt);
- extern void device_pm_schedule_removal(struct device *);
- #else /* !CONFIG_PM_SLEEP */
- static inline void destroy_suspended_device(struct class *cls, dev_t devt)
- {
-       device_destroy(cls, devt);
- }
- static inline void device_pm_schedule_removal(struct device *dev)
- {
-       device_unregister(dev);
- }
- #endif /* !CONFIG_PM_SLEEP */
  
  /*
   * Platform "fixup" functions - allow the platform to have their say
@@@ -608,21 -596,16 +596,16 @@@ extern const char *dev_driver_string(st
  #define dev_dbg(dev, format, arg...)          \
        dev_printk(KERN_DEBUG , dev , format , ## arg)
  #else
- static inline int __attribute__ ((format (printf, 2, 3)))
- dev_dbg(struct device *dev, const char *fmt, ...)
- {
-       return 0;
- }
+ #define dev_dbg(dev, format, arg...)          \
+       ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
  #endif
  
  #ifdef VERBOSE_DEBUG
  #define dev_vdbg      dev_dbg
  #else
- static inline int __attribute__ ((format (printf, 2, 3)))
- dev_vdbg(struct device *dev, const char *fmt, ...)
- {
-       return 0;
- }
+ #define dev_vdbg(dev, format, arg...)         \
+       ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
  #endif
  
  /* Create alias, so I can be autoloaded. */