phy: renesas: r8a779f0-ether-serdes: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230705090126.26854-3-frank.li@vivo.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
1f8fe32601
commit
d746f127ea
|
@ -339,22 +339,15 @@ static int r8a779f0_eth_serdes_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct r8a779f0_eth_serdes_drv_data *dd;
|
struct r8a779f0_eth_serdes_drv_data *dd;
|
||||||
struct phy_provider *provider;
|
struct phy_provider *provider;
|
||||||
struct resource *res;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
||||||
if (!res) {
|
|
||||||
dev_err(&pdev->dev, "invalid resource\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd = devm_kzalloc(&pdev->dev, sizeof(*dd), GFP_KERNEL);
|
dd = devm_kzalloc(&pdev->dev, sizeof(*dd), GFP_KERNEL);
|
||||||
if (!dd)
|
if (!dd)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, dd);
|
platform_set_drvdata(pdev, dd);
|
||||||
dd->pdev = pdev;
|
dd->pdev = pdev;
|
||||||
dd->addr = devm_ioremap_resource(&pdev->dev, res);
|
dd->addr = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (IS_ERR(dd->addr))
|
if (IS_ERR(dd->addr))
|
||||||
return PTR_ERR(dd->addr);
|
return PTR_ERR(dd->addr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue