]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/sysdev/dcr.c
Merge branch 'warnings-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / arch / powerpc / sysdev / dcr.c
index 1fc5819e7d18d595b7f37e364ce9b52e8efe9591..427027c7ea0f61fbeeb7192f2c1125cb64246d22 100644 (file)
 unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
 {
        unsigned int ds;
-       const u32 *dr = get_property(np, "dcr-reg", &ds);
+       const u32 *dr = of_get_property(np, "dcr-reg", &ds);
 
        if (dr == NULL || ds & 1 || index >= (ds / 8))
                return 0;
 
        return dr[index * 2];
 }
+EXPORT_SYMBOL_GPL(dcr_resource_start);
 
 unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
 {
        unsigned int ds;
-       const u32 *dr = get_property(np, "dcr-reg", &ds);
+       const u32 *dr = of_get_property(np, "dcr-reg", &ds);
 
        if (dr == NULL || ds & 1 || index >= (ds / 8))
                return 0;
 
        return dr[index * 2 + 1];
 }
+EXPORT_SYMBOL_GPL(dcr_resource_len);
 
 #ifndef CONFIG_PPC_DCR_NATIVE
 
@@ -53,9 +55,9 @@ static struct device_node * find_dcr_parent(struct device_node * node)
        const u32 *p;
 
        for (par = of_node_get(node); par;) {
-               if (get_property(par, "dcr-controller", NULL))
+               if (of_get_property(par, "dcr-controller", NULL))
                        break;
-               p = get_property(par, "dcr-parent", NULL);
+               p = of_get_property(par, "dcr-parent", NULL);
                tmp = par;
                if (p == NULL)
                        par = of_get_parent(par);
@@ -80,13 +82,13 @@ u64 of_translate_dcr_address(struct device_node *dev,
                return OF_BAD_ADDR;
 
        /* Stride is not properly defined yet, default to 0x10 for Axon */
-       p = get_property(dp, "dcr-mmio-stride", NULL);
+       p = of_get_property(dp, "dcr-mmio-stride", NULL);
        stride = (p == NULL) ? 0x10 : *p;
 
        /* XXX FIXME: Which property name is to use of the 2 following ? */
-       p = get_property(dp, "dcr-mmio-range", NULL);
+       p = of_get_property(dp, "dcr-mmio-range", NULL);
        if (p == NULL)
-               p = get_property(dp, "dcr-mmio-space", NULL);
+               p = of_get_property(dp, "dcr-mmio-space", NULL);
        if (p == NULL)
                return OF_BAD_ADDR;
 
@@ -102,7 +104,7 @@ u64 of_translate_dcr_address(struct device_node *dev,
 dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
                   unsigned int dcr_c)
 {
-       dcr_host_t ret = { .token = NULL, .stride = 0 };
+       dcr_host_t ret = { .token = NULL, .stride = 0, .base = dcr_n };
        u64 addr;
 
        pr_debug("dcr_map(%s, 0x%x, 0x%x)\n",
@@ -122,16 +124,18 @@ dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
        ret.token -= dcr_n * ret.stride;
        return ret;
 }
+EXPORT_SYMBOL_GPL(dcr_map);
 
-void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c)
+void dcr_unmap(dcr_host_t host, unsigned int dcr_c)
 {
        dcr_host_t h = host;
 
        if (h.token == NULL)
                return;
-       h.token += dcr_n * h.stride;
+       h.token += host.base * h.stride;
        iounmap(h.token);
        h.token = NULL;
 }
+EXPORT_SYMBOL_GPL(dcr_unmap);
 
 #endif /* !defined(CONFIG_PPC_DCR_NATIVE) */