提交 58efc77c 编写于 作者: K Kuninori Morimoto 提交者: Greg Kroah-Hartman

usb: renesas_usbhs: convert to devm_xxx()

Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1cd572fc
...@@ -432,17 +432,16 @@ static int usbhs_probe(struct platform_device *pdev) ...@@ -432,17 +432,16 @@ static int usbhs_probe(struct platform_device *pdev)
} }
/* usb private data */ /* usb private data */
priv = kzalloc(sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) { if (!priv) {
dev_err(&pdev->dev, "Could not allocate priv\n"); dev_err(&pdev->dev, "Could not allocate priv\n");
return -ENOMEM; return -ENOMEM;
} }
priv->base = ioremap_nocache(res->start, resource_size(res)); priv->base = devm_request_and_ioremap(&pdev->dev, res);
if (!priv->base) { if (!priv->base) {
dev_err(&pdev->dev, "ioremap error.\n"); dev_err(&pdev->dev, "ioremap error.\n");
ret = -ENOMEM; return -ENOMEM;
goto probe_end_kfree;
} }
/* /*
...@@ -485,7 +484,7 @@ static int usbhs_probe(struct platform_device *pdev) ...@@ -485,7 +484,7 @@ static int usbhs_probe(struct platform_device *pdev)
/* call pipe and module init */ /* call pipe and module init */
ret = usbhs_pipe_probe(priv); ret = usbhs_pipe_probe(priv);
if (ret < 0) if (ret < 0)
goto probe_end_iounmap; return ret;
ret = usbhs_fifo_probe(priv); ret = usbhs_fifo_probe(priv);
if (ret < 0) if (ret < 0)
...@@ -546,10 +545,6 @@ static int usbhs_probe(struct platform_device *pdev) ...@@ -546,10 +545,6 @@ static int usbhs_probe(struct platform_device *pdev)
usbhs_fifo_remove(priv); usbhs_fifo_remove(priv);
probe_end_pipe_exit: probe_end_pipe_exit:
usbhs_pipe_remove(priv); usbhs_pipe_remove(priv);
probe_end_iounmap:
iounmap(priv->base);
probe_end_kfree:
kfree(priv);
dev_info(&pdev->dev, "probe failed\n"); dev_info(&pdev->dev, "probe failed\n");
...@@ -576,8 +571,6 @@ static int __devexit usbhs_remove(struct platform_device *pdev) ...@@ -576,8 +571,6 @@ static int __devexit usbhs_remove(struct platform_device *pdev)
usbhs_mod_remove(priv); usbhs_mod_remove(priv);
usbhs_fifo_remove(priv); usbhs_fifo_remove(priv);
usbhs_pipe_remove(priv); usbhs_pipe_remove(priv);
iounmap(priv->base);
kfree(priv);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册