drivers/net/a2065.c: Convert release_resource to release_region/release_mem_region
authorJulia Lawall <julia@diku.dk>
Tue, 22 Mar 2011 07:15:23 +0000 (07:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Mar 2011 21:10:37 +0000 (14:10 -0700)
Request_mem_region should be used with release_mem_region, not
release_resource.

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

// <smpl>
@@
expression x,E;
@@
*x = request_mem_region(...)
... when != release_mem_region(x)
    when != x = E
* release_resource(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/a2065.c

index f142cc21e453dfddceabee7bd669171977622ed2..deaa8bc16cf8e9238fc1ce9a3b0896fc791aead5 100644 (file)
@@ -711,14 +711,14 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
                return -EBUSY;
        r2 = request_mem_region(mem_start, A2065_RAM_SIZE, "RAM");
        if (!r2) {
-               release_resource(r1);
+               release_mem_region(base_addr, sizeof(struct lance_regs));
                return -EBUSY;
        }
 
        dev = alloc_etherdev(sizeof(struct lance_private));
        if (dev == NULL) {
-               release_resource(r1);
-               release_resource(r2);
+               release_mem_region(base_addr, sizeof(struct lance_regs));
+               release_mem_region(mem_start, A2065_RAM_SIZE);
                return -ENOMEM;
        }
 
@@ -764,8 +764,8 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
 
        err = register_netdev(dev);
        if (err) {
-               release_resource(r1);
-               release_resource(r2);
+               release_mem_region(base_addr, sizeof(struct lance_regs));
+               release_mem_region(mem_start, A2065_RAM_SIZE);
                free_netdev(dev);
                return err;
        }