Skip to content

Commit 6ce7b97

Browse files
Chunfeng Yungregkh
authored andcommitted
usb: phy: am335x: convert to devm_platform_ioremap_resource_byname
Use devm_platform_ioremap_resource_byname() to simplify code Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5ad9181 commit 6ce7b97

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/usb/phy/phy-am335x-control.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ EXPORT_SYMBOL_GPL(am335x_get_phy_control);
149149

150150
static int am335x_control_usb_probe(struct platform_device *pdev)
151151
{
152-
struct resource *res;
153152
struct am335x_control_usb *ctrl_usb;
154153
const struct of_device_id *of_id;
155154
const struct phy_control *phy_ctrl;
@@ -166,13 +165,11 @@ static int am335x_control_usb_probe(struct platform_device *pdev)
166165

167166
ctrl_usb->dev = &pdev->dev;
168167

169-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl");
170-
ctrl_usb->phy_reg = devm_ioremap_resource(&pdev->dev, res);
168+
ctrl_usb->phy_reg = devm_platform_ioremap_resource_byname(pdev, "phy_ctrl");
171169
if (IS_ERR(ctrl_usb->phy_reg))
172170
return PTR_ERR(ctrl_usb->phy_reg);
173171

174-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wakeup");
175-
ctrl_usb->wkup = devm_ioremap_resource(&pdev->dev, res);
172+
ctrl_usb->wkup = devm_platform_ioremap_resource_byname(pdev, "wakeup");
176173
if (IS_ERR(ctrl_usb->wkup))
177174
return PTR_ERR(ctrl_usb->wkup);
178175

0 commit comments

Comments
 (0)