]> git.karo-electronics.de Git - linux-beck.git/blobdiff - arch/arm/mach-integrator/impd1.c
[ARM] Move AMBA include files to include/linux/amba/
[linux-beck.git] / arch / arm / mach-integrator / impd1.c
index c3c2f17d030e5efcc39503c18d37680d670ce582..a85d471c5bfaf0d8e064f7a9dfc59ae8c2abccea 100644 (file)
 #include <linux/device.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
+#include <linux/amba/bus.h>
+#include <linux/amba/clcd.h>
 
 #include <asm/io.h>
 #include <asm/hardware/icst525.h>
-#include <asm/hardware/amba.h>
-#include <asm/hardware/amba_clcd.h>
 #include <asm/arch/lm.h>
 #include <asm/arch/impd1.h>
 #include <asm/sizes.h>
@@ -67,7 +67,7 @@ static void impd1_setvco(struct clk *clk, struct icst525_vco vco)
        }
        writel(0, impd1->base + IMPD1_LOCK);
 
-#if DEBUG
+#ifdef DEBUG
        vco.v = val & 0x1ff;
        vco.r = (val >> 9) & 0x7f;
        vco.s = (val >> 16) & 7;
@@ -420,24 +420,24 @@ static int impd1_probe(struct lm_device *dev)
  free_impd1:
        if (impd1 && impd1->base)
                iounmap(impd1->base);
-       if (impd1)
-               kfree(impd1);
+       kfree(impd1);
  release_lm:
        release_mem_region(dev->resource.start, SZ_4K);
        return ret;
 }
 
+static int impd1_remove_one(struct device *dev, void *data)
+{
+       device_unregister(dev);
+       return 0;
+}
+
 static void impd1_remove(struct lm_device *dev)
 {
        struct impd1_module *impd1 = lm_get_drvdata(dev);
-       struct list_head *l, *n;
        int i;
 
-       list_for_each_safe(l, n, &dev->dev.children) {
-               struct device *d = list_to_dev(l);
-
-               device_unregister(d);
-       }
+       device_for_each_child(&dev->dev, NULL, impd1_remove_one);
 
        for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++)
                clk_unregister(&impd1->vcos[i]);