Skip to content

Commit

Permalink
usb: musb: dsps, use devm_kzalloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Pargmann authored and Felipe Balbi committed Feb 18, 2014
1 parent 30bbae9 commit de9db57
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/musb/musb_dsps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -644,7 +644,6 @@ static int dsps_probe(struct platform_device *pdev)
pm_runtime_put(&pdev->dev);
err2:
pm_runtime_disable(&pdev->dev);
kfree(glue);
return ret;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit de9db57

Please sign in to comment.