usb: musb: dsps, use devm_kzalloc
authorMarkus Pargmann <mpa@pengutronix.de>
Fri, 17 Jan 2014 09:22:36 +0000 (10:22 +0100)
committerFelipe Balbi <balbi@ti.com>
Tue, 18 Feb 2014 16:52:55 +0000 (10:52 -0600)
Replace kzalloc by devm_kzalloc and remove the kfree() calls.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_dsps.c

index 7a109eae9b9acf3cd652259865f7c013376f7459..68c14e1eac66e79534b1e9335baaad3f25e77fea 100644 (file)
@@ -616,7 +616,7 @@ static int dsps_probe(struct platform_device *pdev)
        wrp = match->data;
 
        /* allocate glue */
-       glue = kzalloc(sizeof(*glue), GFP_KERNEL);
+       glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
        if (!glue) {
                dev_err(&pdev->dev, "unable to allocate glue memory\n");
                return -ENOMEM;
@@ -644,7 +644,6 @@ err3:
        pm_runtime_put(&pdev->dev);
 err2:
        pm_runtime_disable(&pdev->dev);
-       kfree(glue);
        return ret;
 }
 
@@ -657,7 +656,6 @@ static int dsps_remove(struct platform_device *pdev)
        /* disable usbss clocks */
        pm_runtime_put(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
-       kfree(glue);
        return 0;
 }