parport: use release_mem_region instead of release_resource
authorAnton Vasilyev <vasilyev@ispras.ru>
Sat, 12 Aug 2017 21:45:50 +0000 (22:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 15:25:43 +0000 (17:25 +0200)
Use api pair of request_mem_region and release_mem_region
instead of release_resource.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/parport/parport_ax88796.c

index 8f8c9f3aa6910fe80ea92a9acdc905571518e540..2fc91edb058df94996df58ff2ad1ac4211e7586e 100644 (file)
@@ -358,8 +358,7 @@ static int parport_ax88796_probe(struct platform_device *pdev)
  exit_unmap:
        iounmap(dd->base);
  exit_res:
-       release_resource(dd->io);
-       kfree(dd->io);
+       release_mem_region(dd->io->start, size);
  exit_mem:
        kfree(dd);
        return ret;
@@ -373,8 +372,7 @@ static int parport_ax88796_remove(struct platform_device *pdev)
        free_irq(p->irq, p);
        parport_remove_port(p);
        iounmap(dd->base);
-       release_resource(dd->io);
-       kfree(dd->io);
+       release_mem_region(dd->io->start, resource_size(dd->io));
        kfree(dd);
 
        return 0;