Merge branch 'linux-2.6' into for-2.6.22
Paul Mackerras [Mon, 30 Apr 2007 02:38:01 +0000 (12:38 +1000)]
1  2 
arch/powerpc/kernel/of_platform.c
arch/powerpc/kernel/ppc_ksyms.c
drivers/infiniband/hw/ehca/ehca_main.c
drivers/macintosh/smu.c
drivers/media/video/planb.c
drivers/net/Kconfig
drivers/video/Kconfig
sound/aoa/soundbus/core.c

@@@ -133,7 -133,6 +133,7 @@@ static int of_platform_device_resume(st
  struct bus_type of_platform_bus_type = {
         .name  = "of_platform",
         .match = of_platform_bus_match,
 +       .uevent        = of_device_uevent,
         .probe = of_platform_device_probe,
         .remove        = of_platform_device_remove,
         .suspend       = of_platform_device_suspend,
@@@ -178,7 -177,7 +178,7 @@@ static void of_platform_make_bus_id(str
         * and 'D' for MMIO DCRs.
         */
  #ifdef CONFIG_PPC_DCR
 -      reg = get_property(node, "dcr-reg", NULL);
 +      reg = of_get_property(node, "dcr-reg", NULL);
        if (reg) {
  #ifdef CONFIG_PPC_DCR_NATIVE
                snprintf(name, BUS_ID_SIZE, "d%x.%s",
        /*
         * For MMIO, get the physical address
         */
 -      reg = get_property(node, "reg", NULL);
 +      reg = of_get_property(node, "reg", NULL);
        if (reg) {
                addr = of_translate_address(node, reg);
                if (addr != OF_BAD_ADDR) {
@@@ -476,9 -475,6 +476,6 @@@ static struct of_platform_driver of_pci
         .name = "of-pci",
         .match_table = of_pci_phb_ids,
         .probe = of_pci_phb_probe,
-        .driver = {
-              .multithread_probe = 1,
-        },
  };
  
  static __init int of_pci_phb_init(void)
@@@ -20,6 -20,7 +20,6 @@@
  #include <asm/processor.h>
  #include <asm/uaccess.h>
  #include <asm/io.h>
 -#include <asm/ide.h>
  #include <asm/atomic.h>
  #include <asm/checksum.h>
  #include <asm/pgtable.h>
@@@ -83,8 -84,6 +83,6 @@@ EXPORT_SYMBOL(strncpy)
  EXPORT_SYMBOL(strcat);
  EXPORT_SYMBOL(strlen);
  EXPORT_SYMBOL(strcmp);
- EXPORT_SYMBOL(strcasecmp);
- EXPORT_SYMBOL(strncasecmp);
  
  EXPORT_SYMBOL(csum_partial);
  EXPORT_SYMBOL(csum_partial_copy_generic);
@@@ -565,11 -565,11 +565,11 @@@ static int __devinit ehca_probe(struct 
                                const struct of_device_id *id)
  {
        struct ehca_shca *shca;
 -      u64 *handle;
 +      const u64 *handle;
        struct ib_pd *ibpd;
        int ret;
  
 -      handle = (u64 *)get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
 +      handle = get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
        if (!handle) {
                ehca_gen_err("Cannot get eHCA handle for adapter: %s.",
                             dev->ofdev.node->full_name);
                ehca_gen_err("Cannot allocate shca memory.");
                return -ENOMEM;
        }
+       mutex_init(&shca->modify_mutex);
  
        shca->ibmebus_dev = dev;
        shca->ipz_hca_handle.handle = *handle;
diff --combined drivers/macintosh/smu.c
@@@ -491,7 -491,7 +491,7 @@@ int __init smu_init (void
                printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n");
                goto fail;
        }
 -      data = get_property(smu->db_node, "reg", NULL);
 +      data = of_get_property(smu->db_node, "reg", NULL);
        if (data == NULL) {
                of_node_put(smu->db_node);
                smu->db_node = NULL;
                smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt");
                if (smu->msg_node == NULL)
                        break;
 -              data = get_property(smu->msg_node, "reg", NULL);
 +              data = of_get_property(smu->msg_node, "reg", NULL);
                if (data == NULL) {
                        of_node_put(smu->msg_node);
                        smu->msg_node = NULL;
@@@ -952,7 -952,7 +952,7 @@@ static struct smu_sdbp_header *smu_crea
        prop->name = ((char *)prop) + tlen - 18;
        sprintf(prop->name, "sdb-partition-%02x", id);
        prop->length = len;
 -      prop->value = (unsigned char *)hdr;
 +      prop->value = hdr;
        prop->next = NULL;
  
        /* Read the datablock */
@@@ -1004,7 -1004,7 +1004,7 @@@ const struct smu_sdbp_header *__smu_get
        } else
                mutex_lock(&smu_part_access);
  
 -      part = get_property(smu->of_node, pname, size);
 +      part = of_get_property(smu->of_node, pname, size);
        if (part == NULL) {
                DPRINTK("trying to extract from SMU ...\n");
                part = smu_create_sdb_partition(id);
@@@ -1259,9 -1259,9 +1259,9 @@@ static int smu_release(struct inode *in
                        set_current_state(TASK_UNINTERRUPTIBLE);
                        if (pp->cmd.status != 1)
                                break;
-                       spin_lock_irqsave(&pp->lock, flags);
-                       schedule();
                        spin_unlock_irqrestore(&pp->lock, flags);
+                       schedule();
+                       spin_lock_irqsave(&pp->lock, flags);
                }
                set_current_state(TASK_RUNNING);
                remove_wait_queue(&pp->wait, &wait);
@@@ -2160,7 -2160,7 +2160,7 @@@ static int find_planb(void
        if (!machine_is(powermac))
                return 0;
  
 -      planb_devices = find_devices("planb");
 +      planb_devices = of_find_node_by_name(NULL, "planb");
        if (planb_devices == 0) {
                planb_num=0;
                printk(KERN_WARNING "PlanB: no device found!\n");
        if (planb_devices->n_addrs != 1) {
                printk (KERN_WARNING "PlanB: expecting 1 address for planb "
                        "(got %d)", planb_devices->n_addrs);
 +              of_node_put(planb_devices);
                return 0;
        }
  
        if (planb_devices->n_intrs == 0) {
                printk(KERN_WARNING "PlanB: no intrs for device %s\n",
                       planb_devices->full_name);
 +              of_node_put(planb_devices);
                return 0;
        } else {
                irq = planb_devices->intrs[0].line;
        confreg = planb_devices->addrs[0].space & 0xff;
        old_base = planb_devices->addrs[0].address;
        new_base = 0xf1000000;
 +      of_node_put(planb_devices);
  
        DEBUG("PlanB: Found on bus %d, dev %d, func %d, "
                "membase 0x%x (base reg. 0x%x)\n",
                bus, PCI_SLOT(dev_fn), PCI_FUNC(dev_fn), old_base, confreg);
  
-       pdev = pci_find_slot (bus, dev_fn);
+       pdev = pci_get_bus_and_slot(bus, dev_fn);
        if (!pdev) {
                printk(KERN_ERR "planb: cannot find slot\n");
                goto err_out;
        pb->planb_base = planb_regs;
        pb->planb_base_phys = (struct planb_registers *)new_base;
        pb->irq = irq;
+       pb->dev = pdev;
  
        return planb_num;
  
@@@ -2247,6 -2245,7 +2248,7 @@@ err_out_disable
        pci_disable_device(pdev);
  err_out:
        /* FIXME handle error */   /* comment moved from pci_find_slot, above */
+       pci_dev_put(pdev);
        return 0;
  }
  
@@@ -2274,6 -2273,8 +2276,8 @@@ static void release_planb(void
                printk(KERN_INFO "PlanB: unregistering with v4l\n");
                video_unregister_device(&pb->video_dev);
  
+               pci_dev_put(pb->dev);
                /* note that iounmap() does nothing on the PPC right now */
                iounmap ((void *)pb->planb_base);
        }
diff --combined drivers/net/Kconfig
@@@ -2263,6 -2263,7 +2263,7 @@@ config GIANFA
        tristate "Gianfar Ethernet"
        depends on 85xx || 83xx || PPC_86xx
        select PHYLIB
+       select CRC32
        help
          This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx,
          and MPC86xx family of chips, and the FEC on the 8540.
@@@ -2272,12 -2273,11 +2273,12 @@@ config GFAR_NAP
        depends on GIANFAR
  
  config UCC_GETH
 -      tristate "Freescale QE UCC GETH"
 -      depends on QUICC_ENGINE && UCC_FAST
 +      tristate "Freescale QE Gigabit Ethernet"
 +      depends on QUICC_ENGINE
 +      select UCC_FAST
        help
 -        This driver supports the Gigabit Ethernet mode of QE UCC.
 -        QE can be found on MPC836x CPUs.
 +        This driver supports the Gigabit Ethernet mode of the QUICC Engine,
 +        which is available on some Freescale SOCs.
  
  config UGETH_NAPI
        bool "NAPI Support"
diff --combined drivers/video/Kconfig
@@@ -139,7 -139,7 +139,7 @@@ config FB_TILEBLITTIN
         This is particularly important to one driver, matroxfb.  If
         unsure, say N.
  
- comment "Frambuffer hardware drivers"
+ comment "Frame buffer hardware drivers"
        depends on FB
  
  config FB_CIRRUS
@@@ -396,7 -396,7 +396,7 @@@ config FB_ATAR
  
  config FB_OF
        bool "Open Firmware frame buffer device support"
 -      depends on (FB = y) && (PPC64 || PPC_OF)
 +      depends on (FB = y) && (PPC64 || PPC_OF) && (!PPC_PSERIES || PCI)
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@@ -61,10 -61,9 +61,9 @@@ static int soundbus_uevent(struct devic
  {
        struct soundbus_dev * soundbus_dev;
        struct of_device * of;
-       char *scratch;
 -      char *compat;
 +      const char *compat;
-       int i = 0;
-       int length, cplen, seen = 0;
+       int retval = 0, i = 0, length = 0;
+       int cplen, seen = 0;
  
        if (!dev)
                return -ENODEV;
        of = &soundbus_dev->ofdev;
  
        /* stuff we want to pass to /sbin/hotplug */
-       envp[i++] = scratch = buffer;
-       length = scnprintf (scratch, buffer_size, "OF_NAME=%s", of->node->name);
-       ++length;
-       buffer_size -= length;
-       if ((buffer_size <= 0) || (i >= num_envp))
-               return -ENOMEM;
-       scratch += length;
-       envp[i++] = scratch;
-       length = scnprintf (scratch, buffer_size, "OF_TYPE=%s", of->node->type);
-       ++length;
-       buffer_size -= length;
-       if ((buffer_size <= 0) || (i >= num_envp))
-               return -ENOMEM;
-       scratch += length;
+       retval = add_uevent_var(envp, num_envp, &i,
+                               buffer, buffer_size, &length,
+                               "OF_NAME=%s", of->node->name);
+       if (retval)
+               return retval;
+       retval = add_uevent_var(envp, num_envp, &i,
+                               buffer, buffer_size, &length,
+                               "OF_TYPE=%s", of->node->type);
+       if (retval)
+               return retval;
  
        /* Since the compatible field can contain pretty much anything
         * it's not really legal to split it out with commas. We split it
         * up using a number of environment variables instead. */
  
 -      compat = (char *) get_property(of->node, "compatible", &cplen);
 +      compat = of_get_property(of->node, "compatible", &cplen);
        while (compat && cplen > 0) {
-               envp[i++] = scratch;
-               length = scnprintf (scratch, buffer_size,
-                                    "OF_COMPATIBLE_%d=%s", seen, compat);
-               ++length;
-               buffer_size -= length;
-               if ((buffer_size <= 0) || (i >= num_envp))
-                       return -ENOMEM;
-               scratch += length;
-               length = strlen (compat) + 1;
-               compat += length;
-               cplen -= length;
-               seen++;
+               int tmp = length;
+               retval = add_uevent_var(envp, num_envp, &i,
+                                       buffer, buffer_size, &length,
+                                       "OF_COMPATIBLE_%d=%s", seen, compat);
+               if (retval)
+                       return retval;
+               compat += length - tmp;
+               cplen -= length - tmp;
+               seen += 1;
        }
  
-       envp[i++] = scratch;
-       length = scnprintf (scratch, buffer_size, "OF_COMPATIBLE_N=%d", seen);
-       ++length;
-       buffer_size -= length;
-       if ((buffer_size <= 0) || (i >= num_envp))
-               return -ENOMEM;
-       scratch += length;
-       envp[i++] = scratch;
-       length = scnprintf (scratch, buffer_size, "MODALIAS=%s",
-                       soundbus_dev->modalias);
-       buffer_size -= length;
-       if ((buffer_size <= 0) || (i >= num_envp))
-               return -ENOMEM;
+       retval = add_uevent_var(envp, num_envp, &i,
+                               buffer, buffer_size, &length,
+                               "OF_COMPATIBLE_N=%d", seen);
+       if (retval)
+               return retval;
+       retval = add_uevent_var(envp, num_envp, &i,
+                               buffer, buffer_size, &length,
+                               "MODALIAS=%s", soundbus_dev->modalias);
  
        envp[i] = NULL;
  
-       return 0;
+       return retval;
  }
  
  static int soundbus_device_remove(struct device *dev)