sparc: Kill SBUS DVMA layer.

This thing was completely pointless.

Just find the OF device in the parent of drivers that want to program
this device, and map the DMA regs inside such drivers too.

This also moves the dummy claim_dma_lock() and release_dma_lock()
implementation to floppy_32.h, which makes it handle this issue
just like floppy_64.h does.

Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 4e994f8..24ffecb 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -248,7 +248,7 @@
 	int		rx_new, tx_new;
 	int		rx_old, tx_old;
 
-	struct sbus_dma *ledma;	/* If set this points to ledma	*/
+	struct of_device *ledma;	/* If set this points to ledma	*/
 	char		tpe;		/* cable-selection is TPE	*/
 	char		auto_select;	/* cable-selection by carrier	*/
 	char		burst_sizes;	/* ledma SBus burst sizes	*/
@@ -1273,6 +1273,12 @@
 {
 	if (lp->lregs)
 		sbus_iounmap(lp->lregs, LANCE_REG_SIZE);
+	if (lp->dregs) {
+		struct of_device *ledma = lp->ledma;
+
+		of_iounmap(&ledma->resource[0], lp->dregs,
+			   resource_size(&ledma->resource[0]));
+	}
 	if (lp->init_block_iomem) {
 		sbus_iounmap(lp->init_block_iomem,
 			     sizeof(struct lance_init_block));
@@ -1309,7 +1315,7 @@
 };
 
 static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev,
-					   struct sbus_dma *ledma,
+					   struct of_device *ledma,
 					   struct sbus_dev *lebuffer)
 {
 	static unsigned version_printed;
@@ -1345,6 +1351,18 @@
 		goto fail;
 	}
 
+	lp->ledma = ledma;
+	if (lp->ledma) {
+		lp->dregs = of_ioremap(&ledma->resource[0], 0,
+				       resource_size(&ledma->resource[0]),
+				       "ledma");
+		if (!lp->dregs) {
+			printk(KERN_ERR "SunLance: Cannot map "
+			       "ledma registers.\n");
+			goto fail;
+		}
+	}
+
 	lp->sdev = sdev;
 	if (lebuffer) {
 		/* sanity check */
@@ -1383,11 +1401,10 @@
 						      LE_C3_BCON));
 
 	lp->name = lancestr;
-	lp->ledma = ledma;
 
 	lp->burst_sizes = 0;
 	if (lp->ledma) {
-		struct device_node *ledma_dp = ledma->sdev->ofdev.node;
+		struct device_node *ledma_dp = ledma->node;
 		const char *prop;
 		unsigned int sbmask;
 		u32 csr;
@@ -1435,8 +1452,6 @@
 			lp->tpe = 1;
 		}
 
-		lp->dregs = ledma->regs;
-
 		/* Reset ledma */
 		csr = sbus_readl(lp->dregs + DMA_CSR);
 		sbus_writel(csr | DMA_RST_ENET, lp->dregs + DMA_CSR);
@@ -1486,18 +1501,6 @@
 	return -ENODEV;
 }
 
-/* On 4m, find the associated dma for the lance chip */
-static struct sbus_dma * __devinit find_ledma(struct sbus_dev *sdev)
-{
-	struct sbus_dma *p;
-
-	for_each_dvma(p) {
-		if (p->sdev == sdev)
-			return p;
-	}
-	return NULL;
-}
-
 #ifdef CONFIG_SUN4
 
 #include <asm/sun4paddr.h>
@@ -1541,13 +1544,13 @@
 	int err;
 
 	if (sdev->parent) {
-		struct of_device *parent = &sdev->parent->ofdev;
+		struct device_node *parent_node = sdev->parent->ofdev.node;
+		struct of_device *parent;
 
-		if (!strcmp(parent->node->name, "ledma")) {
-			struct sbus_dma *ledma = find_ledma(to_sbus_device(&parent->dev));
-
-			err = sparc_lance_probe_one(sdev, ledma, NULL);
-		} else if (!strcmp(parent->node->name, "lebuffer")) {
+		parent = of_find_device_by_node(parent_node);
+		if (parent && !strcmp(parent->node->name, "ledma")) {
+			err = sparc_lance_probe_one(sdev, parent, NULL);
+		} else if (parent && !strcmp(parent->node->name, "lebuffer")) {
 			err = sparc_lance_probe_one(sdev, NULL, to_sbus_device(&parent->dev));
 		} else
 			err = sparc_lance_probe_one(sdev, NULL, NULL);