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

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
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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)
{
	struct resource	*res;
	const struct of_device_id *of_id;
	struct cpsw_phy_sel_priv *priv;

@@ -223,8 +222,7 @@ static int cpsw_phy_sel_probe(struct platform_device *pdev)
	priv->dev = &pdev->dev;
	priv->cpsw_phy_sel = of_id->data;

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gmii-sel");
	priv->gmii_sel = devm_ioremap_resource(&pdev->dev, res);
	priv->gmii_sel = devm_platform_ioremap_resource_byname(pdev, "gmii-sel");
	if (IS_ERR(priv->gmii_sel))
		return PTR_ERR(priv->gmii_sel);