mirror of https://gitee.com/openkylin/linux.git
phy: phy-stm32-usbphyc: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource to simplify code Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com> Link: https://lore.kernel.org/r/1604642930-29019-15-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
2f0c9fac3b
commit
5a77b16c6b
|
@ -311,7 +311,6 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
|
||||||
struct stm32_usbphyc *usbphyc;
|
struct stm32_usbphyc *usbphyc;
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct device_node *child, *np = dev->of_node;
|
struct device_node *child, *np = dev->of_node;
|
||||||
struct resource *res;
|
|
||||||
struct phy_provider *phy_provider;
|
struct phy_provider *phy_provider;
|
||||||
u32 version;
|
u32 version;
|
||||||
int ret, port = 0;
|
int ret, port = 0;
|
||||||
|
@ -322,8 +321,7 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
|
||||||
usbphyc->dev = dev;
|
usbphyc->dev = dev;
|
||||||
dev_set_drvdata(dev, usbphyc);
|
dev_set_drvdata(dev, usbphyc);
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
usbphyc->base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
usbphyc->base = devm_ioremap_resource(dev, res);
|
|
||||||
if (IS_ERR(usbphyc->base))
|
if (IS_ERR(usbphyc->base))
|
||||||
return PTR_ERR(usbphyc->base);
|
return PTR_ERR(usbphyc->base);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue