Commit ba539319 authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller

net: ethernet: ti: cpsw-phy-sel: Use devm_platform_ioremap_resource_byname()

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f00658d
...@@ -206,7 +206,6 @@ static const struct of_device_id cpsw_phy_sel_id_table[] = { ...@@ -206,7 +206,6 @@ static const struct of_device_id cpsw_phy_sel_id_table[] = {
static int cpsw_phy_sel_probe(struct platform_device *pdev) static int cpsw_phy_sel_probe(struct platform_device *pdev)
{ {
struct resource *res;
const struct of_device_id *of_id; const struct of_device_id *of_id;
struct cpsw_phy_sel_priv *priv; struct cpsw_phy_sel_priv *priv;
...@@ -223,8 +222,7 @@ static int cpsw_phy_sel_probe(struct platform_device *pdev) ...@@ -223,8 +222,7 @@ static int cpsw_phy_sel_probe(struct platform_device *pdev)
priv->dev = &pdev->dev; priv->dev = &pdev->dev;
priv->cpsw_phy_sel = of_id->data; priv->cpsw_phy_sel = of_id->data;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gmii-sel"); priv->gmii_sel = devm_platform_ioremap_resource_byname(pdev, "gmii-sel");
priv->gmii_sel = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->gmii_sel)) if (IS_ERR(priv->gmii_sel))
return PTR_ERR(priv->gmii_sel); return PTR_ERR(priv->gmii_sel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment