mirror of
https://github.com/torvalds/linux.git
synced 2024-10-26 06:54:41 +00:00
phy: freescale: 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: Peter Chen <peter.chen@nxp.com> Link: https://lore.kernel.org/r/1604642930-29019-5-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
fa62909400
commit
0b7c4c88b8
|
@ -434,7 +434,6 @@ static int mixel_dphy_probe(struct platform_device *pdev)
|
||||||
struct device_node *np = dev->of_node;
|
struct device_node *np = dev->of_node;
|
||||||
struct phy_provider *phy_provider;
|
struct phy_provider *phy_provider;
|
||||||
struct mixel_dphy_priv *priv;
|
struct mixel_dphy_priv *priv;
|
||||||
struct resource *res;
|
|
||||||
struct phy *phy;
|
struct phy *phy;
|
||||||
void __iomem *base;
|
void __iomem *base;
|
||||||
|
|
||||||
|
@ -449,8 +448,7 @@ static int mixel_dphy_probe(struct platform_device *pdev)
|
||||||
if (!priv->devdata)
|
if (!priv->devdata)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
base = devm_ioremap_resource(dev, res);
|
|
||||||
if (IS_ERR(base))
|
if (IS_ERR(base))
|
||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,6 @@ static int imx8mq_usb_phy_probe(struct platform_device *pdev)
|
||||||
struct phy_provider *phy_provider;
|
struct phy_provider *phy_provider;
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct imx8mq_usb_phy *imx_phy;
|
struct imx8mq_usb_phy *imx_phy;
|
||||||
struct resource *res;
|
|
||||||
const struct phy_ops *phy_ops;
|
const struct phy_ops *phy_ops;
|
||||||
|
|
||||||
imx_phy = devm_kzalloc(dev, sizeof(*imx_phy), GFP_KERNEL);
|
imx_phy = devm_kzalloc(dev, sizeof(*imx_phy), GFP_KERNEL);
|
||||||
|
@ -165,8 +164,7 @@ static int imx8mq_usb_phy_probe(struct platform_device *pdev)
|
||||||
return PTR_ERR(imx_phy->clk);
|
return PTR_ERR(imx_phy->clk);
|
||||||
}
|
}
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
imx_phy->base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
imx_phy->base = devm_ioremap_resource(dev, res);
|
|
||||||
if (IS_ERR(imx_phy->base))
|
if (IS_ERR(imx_phy->base))
|
||||||
return PTR_ERR(imx_phy->base);
|
return PTR_ERR(imx_phy->base);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user