]> err.no Git - linux-2.6/commitdiff
[POWERPC] iommu_free_table doesn't need the device_node
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 6 Dec 2007 02:39:19 +0000 (13:39 +1100)
committerPaul Mackerras <paulus@samba.org>
Tue, 11 Dec 2007 02:41:33 +0000 (13:41 +1100)
It only needs the iommu_table address.  It also makes use of the node
name to print error messages.  So just pass it the things it needs.
This reduces the places that know about the pci_dn by one.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/iommu.c
arch/powerpc/platforms/pseries/iommu.c
include/asm-powerpc/iommu.h

index 2d0c9ef555e9e4578d9df93ff91e025697069c4e..47c3fe55242faa388703bb4ac7a59e7884ba4e04 100644 (file)
@@ -526,16 +526,14 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
        return tbl;
 }
 
-void iommu_free_table(struct device_node *dn)
+void iommu_free_table(struct iommu_table *tbl, const char *node_name)
 {
-       struct pci_dn *pdn = dn->data;
-       struct iommu_table *tbl = pdn->iommu_table;
        unsigned long bitmap_sz, i;
        unsigned int order;
 
        if (!tbl || !tbl->it_map) {
                printk(KERN_ERR "%s: expected TCE map for %s\n", __FUNCTION__,
-                               dn->full_name);
+                               node_name);
                return;
        }
 
@@ -544,7 +542,7 @@ void iommu_free_table(struct device_node *dn)
        for (i = 0; i < (tbl->it_size/64); i++) {
                if (tbl->it_map[i] != 0) {
                        printk(KERN_WARNING "%s: Unexpected TCEs for %s\n",
-                               __FUNCTION__, dn->full_name);
+                               __FUNCTION__, node_name);
                        break;
                }
        }
index be17d2395072c02a67abd37565c956a1221f2699..d4e9d851bb685f06008d2cb945da45682b0d7142 100644 (file)
@@ -556,7 +556,7 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti
        case PSERIES_RECONFIG_REMOVE:
                if (pci && pci->iommu_table &&
                    of_get_property(np, "ibm,dma-window", NULL))
-                       iommu_free_table(np);
+                       iommu_free_table(pci->iommu_table, np->full_name);
                break;
        default:
                err = NOTIFY_DONE;
index 4a82fdccee92a8fd57e5bde18439a05c5e48c02e..7a3cef785abdee2aa52b2cdc6716bdf04348b291 100644 (file)
@@ -69,10 +69,9 @@ struct iommu_table {
 };
 
 struct scatterlist;
-struct device_node;
 
 /* Frees table for an individual device node */
-extern void iommu_free_table(struct device_node *dn);
+extern void iommu_free_table(struct iommu_table *tbl, const char *node_name);
 
 /* Initializes an iommu_table based in values set in the passed-in
  * structure