Commit c9145a2d authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller

drivers/net: Correct use of request_region/request_mem_region

request_mem_region should be used with release_mem_region, not request_region.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r2@
expression start;
@@

request_mem_region(start,...)

@b2@
expression r2.start;
@@

request_region(start,...)

@depends on !b2@
expression r2.start;
expression E;
@@

- release_region
+ release_mem_region
  (start,E)
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bdf50d73
......@@ -203,7 +203,7 @@ static int __devinit sonic_probe1(struct net_device *dev)
return 0;
out:
release_region(dev->base_addr, SONIC_MEM_SIZE);
release_mem_region(dev->base_addr, SONIC_MEM_SIZE);
return err;
}
......@@ -247,7 +247,7 @@ static int __devinit jazz_sonic_probe(struct platform_device *pdev)
return 0;
out1:
release_region(dev->base_addr, SONIC_MEM_SIZE);
release_mem_region(dev->base_addr, SONIC_MEM_SIZE);
out:
free_netdev(dev);
......@@ -269,7 +269,7 @@ static int __devexit jazz_sonic_device_remove (struct platform_device *pdev)
unregister_netdev(dev);
dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
lp->descriptors, lp->descriptors_laddr);
release_region (dev->base_addr, SONIC_MEM_SIZE);
release_mem_region(dev->base_addr, SONIC_MEM_SIZE);
free_netdev(dev);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment