]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/common/sa1111.c
arm: bus_id -> dev_name() and dev_set_name() conversions
[linux-2.6-omap-h63xx.git] / arch / arm / common / sa1111.c
index d5f72010a6f315c122fb50f211690eec45ed39b6..c8e8f0ea59e1b2ce146da5effe3f6ebada19df6d 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
-#include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
@@ -52,6 +51,9 @@ struct sa1111 {
        int             irq;
        spinlock_t      lock;
        void __iomem    *base;
+#ifdef CONFIG_PM
+       void            *saved_state;
+#endif
 };
 
 /*
@@ -147,7 +149,7 @@ void __init sa1111_adjust_zones(int node, unsigned long *size, unsigned long *ho
  * will call us again if there are more interrupts to process.
  */
 static void
-sa1111_irq_handler(unsigned int irq, struct irqdesc *desc)
+sa1111_irq_handler(unsigned int irq, struct irq_desc *desc)
 {
        unsigned int stat0, stat1, i;
        void __iomem *base = get_irq_data(irq);
@@ -187,7 +189,7 @@ static void sa1111_ack_irq(unsigned int irq)
 
 static void sa1111_mask_lowirq(unsigned int irq)
 {
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long ie0;
 
        ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
@@ -197,7 +199,7 @@ static void sa1111_mask_lowirq(unsigned int irq)
 
 static void sa1111_unmask_lowirq(unsigned int irq)
 {
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long ie0;
 
        ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
@@ -215,7 +217,7 @@ static void sa1111_unmask_lowirq(unsigned int irq)
 static int sa1111_retrigger_lowirq(unsigned int irq)
 {
        unsigned int mask = SA1111_IRQMASK_LO(irq);
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long ip0;
        int i;
 
@@ -236,7 +238,7 @@ static int sa1111_retrigger_lowirq(unsigned int irq)
 static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
 {
        unsigned int mask = SA1111_IRQMASK_LO(irq);
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long ip0;
 
        if (flags == IRQT_PROBE)
@@ -259,7 +261,7 @@ static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
 static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
 {
        unsigned int mask = SA1111_IRQMASK_LO(irq);
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long we0;
 
        we0 = sa1111_readl(mapbase + SA1111_WAKEEN0);
@@ -284,7 +286,7 @@ static struct irq_chip sa1111_low_chip = {
 
 static void sa1111_mask_highirq(unsigned int irq)
 {
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long ie1;
 
        ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
@@ -294,7 +296,7 @@ static void sa1111_mask_highirq(unsigned int irq)
 
 static void sa1111_unmask_highirq(unsigned int irq)
 {
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long ie1;
 
        ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
@@ -312,7 +314,7 @@ static void sa1111_unmask_highirq(unsigned int irq)
 static int sa1111_retrigger_highirq(unsigned int irq)
 {
        unsigned int mask = SA1111_IRQMASK_HI(irq);
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long ip1;
        int i;
 
@@ -333,7 +335,7 @@ static int sa1111_retrigger_highirq(unsigned int irq)
 static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
 {
        unsigned int mask = SA1111_IRQMASK_HI(irq);
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long ip1;
 
        if (flags == IRQT_PROBE)
@@ -356,7 +358,7 @@ static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
 static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
 {
        unsigned int mask = SA1111_IRQMASK_HI(irq);
-       void __iomem *mapbase = get_irq_chipdata(irq);
+       void __iomem *mapbase = get_irq_chip_data(irq);
        unsigned long we1;
 
        we1 = sa1111_readl(mapbase + SA1111_WAKEEN1);
@@ -410,15 +412,15 @@ static void sa1111_setup_irq(struct sa1111 *sachip)
 
        for (irq = IRQ_GPAIN0; irq <= SSPROR; irq++) {
                set_irq_chip(irq, &sa1111_low_chip);
-               set_irq_chipdata(irq, irqbase);
-               set_irq_handler(irq, do_edge_IRQ);
+               set_irq_chip_data(irq, irqbase);
+               set_irq_handler(irq, handle_edge_irq);
                set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
        }
 
        for (irq = AUDXMTDMADONEA; irq <= IRQ_S1_BVD1_STSCHG; irq++) {
                set_irq_chip(irq, &sa1111_high_chip);
-               set_irq_chipdata(irq, irqbase);
-               set_irq_handler(irq, do_edge_IRQ);
+               set_irq_chip_data(irq, irqbase);
+               set_irq_handler(irq, handle_edge_irq);
                set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
        }
 
@@ -548,9 +550,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
                goto out;
        }
 
-       snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id),
-                "%4.4lx", info->offset);
-
+       dev_set_name(&dev->dev, "%4.4lx", info->offset);
        dev->devid       = info->devid;
        dev->dev.parent  = sachip->dev;
        dev->dev.bus     = &sa1111_bus_type;
@@ -558,7 +558,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
        dev->dev.coherent_dma_mask = sachip->dev->coherent_dma_mask;
        dev->res.start   = sachip->phys + info->offset;
        dev->res.end     = dev->res.start + 511;
-       dev->res.name    = dev->dev.bus_id;
+       dev->res.name    = dev_name(&dev->dev);
        dev->res.flags   = IORESOURCE_MEM;
        dev->mapbase     = sachip->base + info->offset;
        dev->skpcr_mask  = info->skpcr_mask;
@@ -568,6 +568,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
        if (ret) {
                printk("SA1111: failed to allocate resource for %s\n",
                        dev->res.name);
+               dev_set_name(&dev->dev, NULL);
                kfree(dev);
                goto out;
        }
@@ -591,7 +592,8 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
                if (dev->dma_mask != 0xffffffffUL) {
                        ret = dmabounce_register_dev(&dev->dev, 1024, 4096);
                        if (ret) {
-                               printk("SA1111: Failed to register %s with dmabounce", dev->dev.bus_id);
+                               dev_err(&dev->dev, "SA1111: Failed to register"
+                                       " with dmabounce\n");
                                device_unregister(&dev->dev);
                        }
                }
@@ -823,7 +825,7 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
        save = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL);
        if (!save)
                return -ENOMEM;
-       dev->dev.power.saved_state = save;
+       sachip->saved_state = save;
 
        spin_lock_irqsave(&sachip->lock, flags);
 
@@ -879,7 +881,7 @@ static int sa1111_resume(struct platform_device *dev)
        unsigned long flags, id;
        void __iomem *base;
 
-       save = (struct sa1111_save_data *)dev->dev.power.saved_state;
+       save = sachip->saved_state;
        if (!save)
                return 0;
 
@@ -924,7 +926,7 @@ static int sa1111_resume(struct platform_device *dev)
 
        spin_unlock_irqrestore(&sachip->lock, flags);
 
-       dev->dev.power.saved_state = NULL;
+       sachip->saved_state = NULL;
        kfree(save);
 
        return 0;
@@ -959,8 +961,8 @@ static int sa1111_remove(struct platform_device *pdev)
                platform_set_drvdata(pdev, NULL);
 
 #ifdef CONFIG_PM
-               kfree(pdev->dev.power.saved_state);
-               pdev->dev.power.saved_state = NULL;
+               kfree(sachip->saved_state);
+               sachip->saved_state = NULL;
 #endif
        }