phy: cadence: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource to simplify code Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Acked-by: Peter Chen <peter.chen@nxp.com> Link: https://lore.kernel.org/r/1604642930-29019-4-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
f669bc8b9f
commit
fa62909400
|
@ -314,7 +314,6 @@ static int cdns_dphy_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct phy_provider *phy_provider;
|
||||
struct cdns_dphy *dphy;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
dphy = devm_kzalloc(&pdev->dev, sizeof(*dphy), GFP_KERNEL);
|
||||
|
@ -326,8 +325,7 @@ static int cdns_dphy_probe(struct platform_device *pdev)
|
|||
if (!dphy->ops)
|
||||
return -EINVAL;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
dphy->regs = devm_ioremap_resource(&pdev->dev, res);
|
||||
dphy->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(dphy->regs))
|
||||
return PTR_ERR(dphy->regs);
|
||||
|
||||
|
|
|
@ -263,7 +263,6 @@ static int cdns_salvo_phy_probe(struct platform_device *pdev)
|
|||
struct phy_provider *phy_provider;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct cdns_salvo_phy *salvo_phy;
|
||||
struct resource *res;
|
||||
const struct of_device_id *match;
|
||||
struct cdns_salvo_data *data;
|
||||
|
||||
|
@ -281,8 +280,7 @@ static int cdns_salvo_phy_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(salvo_phy->clk))
|
||||
return PTR_ERR(salvo_phy->clk);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
salvo_phy->base = devm_ioremap_resource(dev, res);
|
||||
salvo_phy->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(salvo_phy->base))
|
||||
return PTR_ERR(salvo_phy->base);
|
||||
|
||||
|
|
|
@ -479,7 +479,6 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
|
|||
const struct of_device_id *match;
|
||||
struct cdns_sierra_data *data;
|
||||
unsigned int id_value;
|
||||
struct resource *res;
|
||||
int i, ret, node = 0;
|
||||
void __iomem *base;
|
||||
struct clk *clk;
|
||||
|
@ -502,8 +501,7 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
|
|||
sp->dev = dev;
|
||||
sp->init_data = data;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
base = devm_ioremap_resource(dev, res);
|
||||
base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(base)) {
|
||||
dev_err(dev, "missing \"reg\"\n");
|
||||
return PTR_ERR(base);
|
||||
|
|
Loading…
Reference in a new issue