Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: phy: am335x: convert to devm_platform_ioremap_resource_byname

Use devm_platform_ioremap_resource_byname() to simplify code

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1595404275-8449-2-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Chunfeng Yun and committed by
Greg Kroah-Hartman
6ce7b97c 5ad91812

+2 -5
+2 -5
drivers/usb/phy/phy-am335x-control.c
··· 149 149 150 150 static int am335x_control_usb_probe(struct platform_device *pdev) 151 151 { 152 - struct resource *res; 153 152 struct am335x_control_usb *ctrl_usb; 154 153 const struct of_device_id *of_id; 155 154 const struct phy_control *phy_ctrl; ··· 165 166 166 167 ctrl_usb->dev = &pdev->dev; 167 168 168 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl"); 169 - ctrl_usb->phy_reg = devm_ioremap_resource(&pdev->dev, res); 169 + ctrl_usb->phy_reg = devm_platform_ioremap_resource_byname(pdev, "phy_ctrl"); 170 170 if (IS_ERR(ctrl_usb->phy_reg)) 171 171 return PTR_ERR(ctrl_usb->phy_reg); 172 172 173 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wakeup"); 174 - ctrl_usb->wkup = devm_ioremap_resource(&pdev->dev, res); 173 + ctrl_usb->wkup = devm_platform_ioremap_resource_byname(pdev, "wakeup"); 175 174 if (IS_ERR(ctrl_usb->wkup)) 176 175 return PTR_ERR(ctrl_usb->wkup); 177 176