]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/sysdev/dcr.c
Merge branch 'orion-fixes2'
[linux-2.6-omap-h63xx.git] / arch / powerpc / sysdev / dcr.c
index e82d54de8a8db06cee43fec4f67a73af8f6bea19..437e48d3ae3340d5817c10f20d2a6dfc8276daeb 100644 (file)
@@ -104,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",
@@ -126,16 +126,17 @@ dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
 }
 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) */
+#else  /* defined(CONFIG_PPC_DCR_NATIVE) */
+DEFINE_SPINLOCK(dcr_ind_lock);
+#endif /* !defined(CONFIG_PPC_DCR_NATIVE) */