Commit 6ce7b97c authored by Chunfeng Yun's avatar Chunfeng Yun Committed by Greg Kroah-Hartman

usb: phy: am335x: convert to devm_platform_ioremap_resource_byname

Use devm_platform_ioremap_resource_byname() to simplify code
Signed-off-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1595404275-8449-2-git-send-email-chunfeng.yun@mediatek.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5ad91812
...@@ -149,7 +149,6 @@ EXPORT_SYMBOL_GPL(am335x_get_phy_control); ...@@ -149,7 +149,6 @@ EXPORT_SYMBOL_GPL(am335x_get_phy_control);
static int am335x_control_usb_probe(struct platform_device *pdev) static int am335x_control_usb_probe(struct platform_device *pdev)
{ {
struct resource *res;
struct am335x_control_usb *ctrl_usb; struct am335x_control_usb *ctrl_usb;
const struct of_device_id *of_id; const struct of_device_id *of_id;
const struct phy_control *phy_ctrl; const struct phy_control *phy_ctrl;
...@@ -166,13 +165,11 @@ static int am335x_control_usb_probe(struct platform_device *pdev) ...@@ -166,13 +165,11 @@ static int am335x_control_usb_probe(struct platform_device *pdev)
ctrl_usb->dev = &pdev->dev; ctrl_usb->dev = &pdev->dev;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl"); ctrl_usb->phy_reg = devm_platform_ioremap_resource_byname(pdev, "phy_ctrl");
ctrl_usb->phy_reg = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(ctrl_usb->phy_reg)) if (IS_ERR(ctrl_usb->phy_reg))
return PTR_ERR(ctrl_usb->phy_reg); return PTR_ERR(ctrl_usb->phy_reg);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wakeup"); ctrl_usb->wkup = devm_platform_ioremap_resource_byname(pdev, "wakeup");
ctrl_usb->wkup = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(ctrl_usb->wkup)) if (IS_ERR(ctrl_usb->wkup))
return PTR_ERR(ctrl_usb->wkup); return PTR_ERR(ctrl_usb->wkup);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment