phy: allwinner: convert to devm_platform_ioremap_resource(_byname)
Subsystems (19)
Chunfeng Yun
maintainerPATCH v2 1/17 phy: allwinner: convert to devm_platform_ioremap_resource(_byname)
Use devm_platform_ioremap_resource(_byname) to simplify code
---
v2: no changes
--- drivers/phy/allwinner/phy-sun4i-usb.c | 8 ++------ drivers/phy/allwinner/phy-sun50i-usb3.c | 4 +--- drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 4 +--- drivers/phy/allwinner/phy-sun9i-usb.c | 4 +--- 4 files changed, 5 insertions(+), 15 deletions(-)
drivers/phy/allwinner/phy-sun4i-usb.c +2 -6
@@ -686,7 +686,6 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;struct phy_provider *phy_provider; -struct resource *res;int i, ret; data =devm_kzalloc (dev,sizeof (*data),GFP_KERNEL );
@@ -700,8 +699,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)if (!data->cfg)return -EINVAL ; - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"phy_ctrl" ); - data->base =devm_ioremap_resource (dev, res); + data->base =devm_platform_ioremap_resource_byname (pdev,"phy_ctrl" );if (IS_ERR (data->base))return PTR_ERR (data->base);
@@ -796,9 +794,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)if (i || data->cfg->phy0_dual_route) {/* No pmu for musb */ snprintf (name,sizeof (name),"pmu%d" , i); - res =platform_get_resource_byname (pdev, -IORESOURCE_MEM , name); - phy->pmu =devm_ioremap_resource (dev, res); + phy->pmu =devm_platform_ioremap_resource_byname (pdev, name);if (IS_ERR (phy->pmu))return PTR_ERR (phy->pmu); }
drivers/phy/allwinner/phy-sun50i-usb3.c +1 -3
@@ -134,7 +134,6 @@ static int sun50i_usb3_phy_probe(struct platform_device *pdev)struct sun50i_usb3_phy *phy;struct device *dev = &pdev->dev;struct phy_provider *phy_provider; -struct resource *res; phy =devm_kzalloc (dev,sizeof (*phy),GFP_KERNEL );if (!phy)
@@ -153,8 +152,7 @@ static int sun50i_usb3_phy_probe(struct platform_device *pdev)return PTR_ERR (phy->reset); } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy->regs =devm_ioremap_resource (dev, res); + phy->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy->regs))return PTR_ERR (phy->regs);
drivers/phy/allwinner/phy-sun6i-mipi-dphy.c +1 -3
@@ -253,15 +253,13 @@ static int sun6i_dphy_probe(struct platform_device *pdev) {struct phy_provider *phy_provider;struct sun6i_dphy *dphy; -struct resource *res;void __iomem *regs; dphy =devm_kzalloc (&pdev->dev,sizeof (*dphy),GFP_KERNEL );if (!dphy)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - regs =devm_ioremap_resource (&pdev->dev, res); + regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (regs)) {dev_err (&pdev->dev,"Couldn't map the DPHY encoder registers\n" );return PTR_ERR (regs);
drivers/phy/allwinner/phy-sun9i-usb.c +1 -3
@@ -117,7 +117,6 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;struct phy_provider *phy_provider; -struct resource *res; phy =devm_kzalloc (dev,sizeof (*phy),GFP_KERNEL );if (!phy)
@@ -156,8 +155,7 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev) } } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy->pmu =devm_ioremap_resource (dev, res); + phy->pmu =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy->pmu))return PTR_ERR (phy->pmu);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 2/17 phy: amlogic: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource to simplify code
---
v2:
1. abandon modification of phy-meson-axg-mipi-pcie-analog.c suggested by Remi
2. add Reviewed-by Remi
--- drivers/phy/amlogic/phy-meson-axg-pcie.c | 4 +--- drivers/phy/amlogic/phy-meson-g12a-usb2.c | 4 +--- drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c | 4 +--- drivers/phy/amlogic/phy-meson-gxl-usb2.c | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-)
drivers/phy/amlogic/phy-meson-axg-pcie.c +1 -3
@@ -129,7 +129,6 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct phy_axg_pcie_priv *priv;struct device_node *np = dev->of_node; -struct resource *res;void __iomem *base;int ret;
@@ -145,8 +144,7 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)return ret; } - 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))return PTR_ERR (base);
drivers/phy/amlogic/phy-meson-g12a-usb2.c +1 -3
@@ -292,7 +292,6 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct phy_provider *phy_provider; -struct resource *res;struct phy_meson_g12a_usb2_priv *priv;struct phy *phy;void __iomem *base;
@@ -305,8 +304,7 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev) priv->dev = dev;platform_set_drvdata (pdev, priv); - 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))return PTR_ERR (base);
drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c +1 -3
@@ -386,7 +386,6 @@ static int phy_g12a_usb3_pcie_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;struct phy_g12a_usb3_pcie_priv *priv; -struct resource *res;struct phy_provider *phy_provider;void __iomem *base;int ret;
@@ -395,8 +394,7 @@ static int phy_g12a_usb3_pcie_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; - 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))return PTR_ERR (base);
drivers/phy/amlogic/phy-meson-gxl-usb2.c +1 -3
@@ -230,7 +230,6 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct phy_provider *phy_provider; -struct resource *res;struct phy_meson_gxl_usb2_priv *priv;struct phy *phy;void __iomem *base;
@@ -242,8 +241,7 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)platform_set_drvdata (pdev, priv); - 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))return PTR_ERR (base);
Signature · 5 lines
2.18.0 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH v2 02/17] phy: amlogic: convert to devm_platform_ioremap_resource
Quoted 5 lines · Chunfeng Yun
Use
devm_platform_ioremap_resourceto simplify codeSigned-off-by Chunfeng Yun <[email protected]>Reviewed-by Remi Pommarel <[email protected]>
Chunfeng Yun
maintainerPATCH v2 3/17 phy: broadcom: convert to devm_platform_ioremap_resource(_byname)
In reply to Chunfeng YunUse devm_platform_ioremap_resource(_byname) to simplify code
---
v2: add Reviewed-by Florian
--- drivers/phy/broadcom/phy-bcm-cygnus-pcie.c | 4 +--- drivers/phy/broadcom/phy-bcm-kona-usb2.c | 4 +--- drivers/phy/broadcom/phy-bcm-ns-usb2.c | 4 +--- drivers/phy/broadcom/phy-bcm-ns-usb3.c | 7 ++----- drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c | 13 ++++--------- drivers/phy/broadcom/phy-bcm-sr-pcie.c | 5 +---- drivers/phy/broadcom/phy-bcm-sr-usb.c | 4 +--- drivers/phy/broadcom/phy-brcm-sata.c | 8 ++------ 8 files changed, 13 insertions(+), 36 deletions(-)
drivers/phy/broadcom/phy-bcm-cygnus-pcie.c +1 -3
@@ -126,7 +126,6 @@ static int cygnus_pcie_phy_probe(struct platform_device *pdev)struct device_node *node = dev->of_node, *child;struct cygnus_pcie_phy_core *core;struct phy_provider *provider; -struct resource *res;unsigned cnt =0 ;int ret;
@@ -141,8 +140,7 @@ static int cygnus_pcie_phy_probe(struct platform_device *pdev) core->dev = dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - core->base =devm_ioremap_resource (dev, res); + core->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (core->base))return PTR_ERR (core->base);
drivers/phy/broadcom/phy-bcm-kona-usb2.c +1 -3
@@ -94,7 +94,6 @@ static int bcm_kona_usb2_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct bcm_kona_usb *phy; -struct resource *res;struct phy *gphy;struct phy_provider *phy_provider;
@@ -102,8 +101,7 @@ static int bcm_kona_usb2_probe(struct platform_device *pdev)if (!phy)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy->regs =devm_ioremap_resource (&pdev->dev, res); + phy->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy->regs))return PTR_ERR (phy->regs);
drivers/phy/broadcom/phy-bcm-ns-usb2.c +1 -3
@@ -83,7 +83,6 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct bcm_ns_usb2 *usb2; -struct resource *res;struct phy_provider *phy_provider; usb2 =devm_kzalloc (&pdev->dev,sizeof (*usb2),GFP_KERNEL );
@@ -91,8 +90,7 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)return -ENOMEM ; usb2->dev = dev; - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"dmu" ); - usb2->dmu =devm_ioremap_resource (dev, res); + usb2->dmu =devm_platform_ioremap_resource_byname (pdev,"dmu" );if (IS_ERR (usb2->dmu)) {dev_err (dev,"Failed to map DMU regs\n" );return PTR_ERR (usb2->dmu);
drivers/phy/broadcom/phy-bcm-ns-usb3.c +2 -5
@@ -305,7 +305,6 @@ static int bcm_ns_usb3_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;const struct of_device_id *of_id;struct bcm_ns_usb3 *usb3; -struct resource *res;struct phy_provider *phy_provider; usb3 =devm_kzalloc (dev,sizeof (*usb3),GFP_KERNEL );
@@ -319,15 +318,13 @@ static int bcm_ns_usb3_probe(struct platform_device *pdev)return -EINVAL ; usb3->family = (enum bcm_ns_family )of_id->data; - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"dmp" ); - usb3->dmp =devm_ioremap_resource (dev, res); + usb3->dmp =devm_platform_ioremap_resource_byname (pdev,"dmp" );if (IS_ERR (usb3->dmp)) {dev_err (dev,"Failed to map DMP regs\n" );return PTR_ERR (usb3->dmp); } - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"ccb-mii" ); - usb3->ccb_mii =devm_ioremap_resource (dev, res); + usb3->ccb_mii =devm_platform_ioremap_resource_byname (pdev,"ccb-mii" );if (IS_ERR (usb3->ccb_mii)) {dev_err (dev,"Failed to map ChipCommon B MII regs\n" );return PTR_ERR (usb3->ccb_mii);
drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c +4 -9
@@ -293,7 +293,6 @@ static int ns2_drd_phy_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct ns2_phy_driver *driver;struct ns2_phy_data *data; -struct resource *res;int ret;u32 val;
@@ -307,23 +306,19 @@ static int ns2_drd_phy_probe(struct platform_device *pdev)if (!driver->data)return -ENOMEM ; - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"icfg" ); - driver->icfgdrd_regs =devm_ioremap_resource (dev, res); + driver->icfgdrd_regs =devm_platform_ioremap_resource_byname (pdev,"icfg" );if (IS_ERR (driver->icfgdrd_regs))return PTR_ERR (driver->icfgdrd_regs); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"rst-ctrl" ); - driver->idmdrd_rst_ctrl =devm_ioremap_resource (dev, res); + driver->idmdrd_rst_ctrl =devm_platform_ioremap_resource_byname (pdev,"rst-ctrl" );if (IS_ERR (driver->idmdrd_rst_ctrl))return PTR_ERR (driver->idmdrd_rst_ctrl); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"crmu-ctrl" ); - driver->crmu_usb2_ctrl =devm_ioremap_resource (dev, res); + driver->crmu_usb2_ctrl =devm_platform_ioremap_resource_byname (pdev,"crmu-ctrl" );if (IS_ERR (driver->crmu_usb2_ctrl))return PTR_ERR (driver->crmu_usb2_ctrl); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"usb2-strap" ); - driver->usb2h_strap_reg =devm_ioremap_resource (dev, res); + driver->usb2h_strap_reg =devm_platform_ioremap_resource_byname (pdev,"usb2-strap" );if (IS_ERR (driver->usb2h_strap_reg))return PTR_ERR (driver->usb2h_strap_reg);
drivers/phy/broadcom/phy-bcm-sr-pcie.c +1 -4
@@ -217,7 +217,6 @@ static int sr_pcie_phy_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *node = dev->of_node;struct sr_pcie_phy_core *core; -struct resource *res;struct phy_provider *provider;unsigned int phy_idx =0 ;
@@ -226,9 +225,7 @@ static int sr_pcie_phy_probe(struct platform_device *pdev)return -ENOMEM ; core->dev = dev; - - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - core->base =devm_ioremap_resource (core->dev, res); + core->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (core->base))return PTR_ERR (core->base);
drivers/phy/broadcom/phy-bcm-sr-usb.c +1 -3
@@ -300,14 +300,12 @@ static int bcm_usb_phy_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *dn = dev->of_node;const struct of_device_id *of_id; -struct resource *res;void __iomem *regs;int ret;enum bcm_usb_phy_version version;struct phy_provider *phy_provider; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - regs =devm_ioremap_resource (dev, res); + regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (regs))return PTR_ERR (regs);
drivers/phy/broadcom/phy-brcm-sata.c +2 -6
@@ -726,7 +726,6 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)struct device_node *dn = dev->of_node, *child;const struct of_device_id *of_id;struct brcm_sata_phy *priv; -struct resource *res;struct phy_provider *provider;int ret, count =0 ;
@@ -739,8 +738,7 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)dev_set_drvdata (dev, priv); priv->dev = dev; - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"phy" ); - priv->phy_base =devm_ioremap_resource (dev, res); + priv->phy_base =devm_platform_ioremap_resource_byname (pdev,"phy" );if (IS_ERR (priv->phy_base))return PTR_ERR (priv->phy_base);
@@ -751,9 +749,7 @@ static int brcm_sata_phy_probe(struct platform_device *pdev) priv->version =BRCM_SATA_PHY_STB_28NM ;if (priv->version ==BRCM_SATA_PHY_IPROC_NS2 ) { - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"phy-ctrl" ); - priv->ctrl_base =devm_ioremap_resource (dev, res); + priv->ctrl_base =devm_platform_ioremap_resource_byname (pdev,"phy-ctrl" );if (IS_ERR (priv->ctrl_base))return PTR_ERR (priv->ctrl_base); }
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 4/17 phy: cadence: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: add Acked-by Peter
--- drivers/phy/cadence/cdns-dphy.c | 4 +--- drivers/phy/cadence/phy-cadence-salvo.c | 4 +--- drivers/phy/cadence/phy-cadence-sierra.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-)
drivers/phy/cadence/cdns-dphy.c +1 -3
@@ -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);
drivers/phy/cadence/phy-cadence-salvo.c +1 -3
@@ -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);
drivers/phy/cadence/phy-cadence-sierra.c +1 -3
@@ -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);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 5/17 phy: freescale: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: add Reviewed-by Peter
--- drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c | 4 +--- drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c +1 -3
@@ -434,7 +434,6 @@ static int mixel_dphy_probe(struct platform_device *pdev)struct device_node *np = dev->of_node;struct phy_provider *phy_provider;struct mixel_dphy_priv *priv; -struct resource *res;struct phy *phy;void __iomem *base;
@@ -449,8 +448,7 @@ static int mixel_dphy_probe(struct platform_device *pdev)if (!priv->devdata)return -EINVAL ; - 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))return PTR_ERR (base);
drivers/phy/freescale/phy-fsl-imx8mq-usb.c +1 -3
@@ -152,7 +152,6 @@ static int imx8mq_usb_phy_probe(struct platform_device *pdev)struct phy_provider *phy_provider;struct device *dev = &pdev->dev;struct imx8mq_usb_phy *imx_phy; -struct resource *res;const struct phy_ops *phy_ops; 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); } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - imx_phy->base =devm_ioremap_resource (dev, res); + imx_phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (imx_phy->base))return PTR_ERR (imx_phy->base);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 6/17 phy: lantiq: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: no changes
--- drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c +1 -3
@@ -402,7 +402,6 @@ static int ltq_vrx200_pcie_phy_probe(struct platform_device *pdev)struct ltq_vrx200_pcie_phy_priv *priv;struct device *dev = &pdev->dev;struct phy_provider *provider; -struct resource *res;void __iomem *base;int ret;
@@ -410,8 +409,7 @@ static int ltq_vrx200_pcie_phy_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; - 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))return PTR_ERR (base);
Signature · 1 line
2.18.0
Re: [PATCH v2 06/17] phy: lantiq: convert to devm_platform_ioremap_resource
Quoted 4 lines · Chunfeng Yun
Use
devm_platform_ioremap_resourceto simplify codeSigned-off-by Chunfeng Yun <[email protected]>
Chunfeng Yun
maintainerPATCH v2 7/17 phy: marvell: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: no changes
--- drivers/phy/marvell/phy-armada375-usb2.c | 4 +--- drivers/phy/marvell/phy-berlin-usb.c | 4 +--- drivers/phy/marvell/phy-mmp3-usb.c | 4 +--- drivers/phy/marvell/phy-mvebu-sata.c | 4 +--- drivers/phy/marvell/phy-pxa-28nm-hsic.c | 4 +--- drivers/phy/marvell/phy-pxa-28nm-usb2.c | 4 +--- drivers/phy/marvell/phy-pxa-usb.c | 4 +--- 7 files changed, 7 insertions(+), 21 deletions(-)
drivers/phy/marvell/phy-armada375-usb2.c +1 -3
@@ -105,15 +105,13 @@ static int armada375_usb_phy_probe(struct platform_device *pdev)struct phy *phy;struct phy_provider *phy_provider;void __iomem *usb_cluster_base; -struct resource *res;struct armada375_cluster_phy *cluster_phy; cluster_phy =devm_kzalloc (dev,sizeof (*cluster_phy),GFP_KERNEL );if (!cluster_phy)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - usb_cluster_base =devm_ioremap_resource (&pdev->dev, res); + usb_cluster_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (usb_cluster_base))return PTR_ERR (usb_cluster_base);
drivers/phy/marvell/phy-berlin-usb.c +1 -3
@@ -165,7 +165,6 @@ static int phy_berlin_usb_probe(struct platform_device *pdev)const struct of_device_id *match =of_match_device (phy_berlin_usb_of_match, &pdev->dev);struct phy_berlin_usb_priv *priv; -struct resource *res;struct phy *phy;struct phy_provider *phy_provider;
@@ -173,8 +172,7 @@ static int phy_berlin_usb_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - priv->base =devm_ioremap_resource (&pdev->dev, res); + priv->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->base))return PTR_ERR (priv->base);
drivers/phy/marvell/phy-mmp3-usb.c +1 -3
@@ -246,7 +246,6 @@ MODULE_DEVICE_TABLE(of, mmp3_usb_phy_of_match);static int mmp3_usb_phy_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *resource;struct mmp3_usb_phy *mmp3_usb_phy;struct phy_provider *provider;
@@ -254,8 +253,7 @@ static int mmp3_usb_phy_probe(struct platform_device *pdev)if (!mmp3_usb_phy)return -ENOMEM ; - resource =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - mmp3_usb_phy->base =devm_ioremap_resource (dev, resource); + mmp3_usb_phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mmp3_usb_phy->base)) {dev_err (dev,"failed to remap PHY regs\n" );return PTR_ERR (mmp3_usb_phy->base);
drivers/phy/marvell/phy-mvebu-sata.c +1 -3
@@ -80,7 +80,6 @@ static const struct phy_ops phy_mvebu_sata_ops = {static int phy_mvebu_sata_probe (struct platform_device *pdev) {struct phy_provider *phy_provider; -struct resource *res;struct priv *priv;struct phy *phy;
@@ -88,8 +87,7 @@ static int phy_mvebu_sata_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - priv->base =devm_ioremap_resource (&pdev->dev, res); + priv->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->base))return PTR_ERR (priv->base);
drivers/phy/marvell/phy-pxa-28nm-hsic.c +1 -3
@@ -162,7 +162,6 @@ static int mv_hsic_phy_probe(struct platform_device *pdev) {struct phy_provider *phy_provider;struct mv_hsic_phy *mv_phy; -struct resource *r; mv_phy =devm_kzalloc (&pdev->dev,sizeof (*mv_phy),GFP_KERNEL );if (!mv_phy)
@@ -176,8 +175,7 @@ static int mv_hsic_phy_probe(struct platform_device *pdev)return PTR_ERR (mv_phy->clk); } - r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - mv_phy->base =devm_ioremap_resource (&pdev->dev, r); + mv_phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mv_phy->base))return PTR_ERR (mv_phy->base);
drivers/phy/marvell/phy-pxa-28nm-usb2.c +1 -3
@@ -294,7 +294,6 @@ static int mv_usb2_phy_probe(struct platform_device *pdev) {struct phy_provider *phy_provider;struct mv_usb2_phy *mv_phy; -struct resource *r; mv_phy =devm_kzalloc (&pdev->dev,sizeof (*mv_phy),GFP_KERNEL );if (!mv_phy)
@@ -308,8 +307,7 @@ static int mv_usb2_phy_probe(struct platform_device *pdev)return PTR_ERR (mv_phy->clk); } - r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - mv_phy->base =devm_ioremap_resource (&pdev->dev, r); + mv_phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mv_phy->base))return PTR_ERR (mv_phy->base);
drivers/phy/marvell/phy-pxa-usb.c +1 -3
@@ -286,7 +286,6 @@ MODULE_DEVICE_TABLE(of, pxa_usb_phy_of_match);static int pxa_usb_phy_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *resource;struct pxa_usb_phy *pxa_usb_phy;struct phy_provider *provider;const struct of_device_id *of_id;
@@ -301,8 +300,7 @@ static int pxa_usb_phy_probe(struct platform_device *pdev)else pxa_usb_phy->version =PXA_USB_PHY_MMP2 ; - resource =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - pxa_usb_phy->base =devm_ioremap_resource (dev, resource); + pxa_usb_phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (pxa_usb_phy->base)) {dev_err (dev,"failed to remap PHY regs\n" );return PTR_ERR (pxa_usb_phy->base);
Signature · 1 line
2.18.0
Re: [PATCH v2 07/17] phy: marvell: convert to devm_platform_ioremap_resource
Quoted 9 lines · On Fri, 6 Nov 2020 14:08:40 +0800 Chunfeng Yun <[email protected]>…
Use
devm_platform_ioremap_resourceto simplify codeSigned-off-by Chunfeng Yun <[email protected]>---
v2: no changes--- drivers/phy/marvell/phy-armada375-usb2.c | 4 +--- drivers/phy/marvell/phy-berlin-usb.c | 4 +---
For phy-berlin-usb.c,
Quoted 166 lines
drivers/phy/marvell/phy-mmp3-usb.c | 4 +--- drivers/phy/marvell/phy-mvebu-sata.c | 4 +--- drivers/phy/marvell/phy-pxa-28nm-hsic.c | 4 +--- drivers/phy/marvell/phy-pxa-28nm-usb2.c | 4 +--- drivers/phy/marvell/phy-pxa-usb.c | 4 +--- 7 files changed, 7 insertions(+), 21 deletions(-)drivers/phy/marvell/phy-armada375-usb2.c +1
-3@@ -105,15 +105,13 @@ static int armada375_usb_phy_probe(struct platform_device *pdev)struct phy *phy;struct phy_provider *phy_provider;void __iomem *usb_cluster_base; -struct resource *res;struct armada375_cluster_phy *cluster_phy; cluster_phy =devm_kzalloc (dev,sizeof (*cluster_phy),GFP_KERNEL );if (!cluster_phy)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - usb_cluster_base =devm_ioremap_resource (&pdev->dev, res); + usb_cluster_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (usb_cluster_base))return PTR_ERR (usb_cluster_base);drivers/phy/marvell/phy-berlin-usb.c +1
-3@@ -165,7 +165,6 @@ static int phy_berlin_usb_probe(struct platform_device *pdev)const struct of_device_id *match =of_match_device (phy_berlin_usb_of_match, &pdev->dev);struct phy_berlin_usb_priv *priv; -struct resource *res;struct phy *phy;struct phy_provider *phy_provider;@@ -173,8 +172,7 @@ static int phy_berlin_usb_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - priv->base =devm_ioremap_resource (&pdev->dev, res); + priv->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->base))return PTR_ERR (priv->base);drivers/phy/marvell/phy-mmp3-usb.c +1
-3@@ -246,7 +246,6 @@ MODULE_DEVICE_TABLE(of, mmp3_usb_phy_of_match);static int mmp3_usb_phy_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *resource;struct mmp3_usb_phy *mmp3_usb_phy;struct phy_provider *provider;@@ -254,8 +253,7 @@ static int mmp3_usb_phy_probe(struct platform_device *pdev)if (!mmp3_usb_phy)return -ENOMEM ; - resource =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - mmp3_usb_phy->base =devm_ioremap_resource (dev, resource); + mmp3_usb_phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mmp3_usb_phy->base)) {dev_err (dev,"failed to remap PHY regs\n" );return PTR_ERR (mmp3_usb_phy->base);drivers/phy/marvell/phy-mvebu-sata.c +1
-3@@ -80,7 +80,6 @@ static const struct phy_ops phy_mvebu_sata_ops = {static int phy_mvebu_sata_probe (struct platform_device *pdev) {struct phy_provider *phy_provider; -struct resource *res;struct priv *priv;struct phy *phy;@@ -88,8 +87,7 @@ static int phy_mvebu_sata_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - priv->base =devm_ioremap_resource (&pdev->dev, res); + priv->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->base))return PTR_ERR (priv->base);drivers/phy/marvell/phy-pxa-28nm-hsic.c +1
-3@@ -162,7 +162,6 @@ static int mv_hsic_phy_probe(struct platform_device *pdev) {struct phy_provider *phy_provider;struct mv_hsic_phy *mv_phy; -struct resource *r; mv_phy =devm_kzalloc (&pdev->dev,sizeof (*mv_phy),GFP_KERNEL );if (!mv_phy)@@ -176,8 +175,7 @@ static int mv_hsic_phy_probe(struct platform_device *pdev)return PTR_ERR (mv_phy->clk); } - r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - mv_phy->base =devm_ioremap_resource (&pdev->dev, r); + mv_phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mv_phy->base))return PTR_ERR (mv_phy->base);drivers/phy/marvell/phy-pxa-28nm-usb2.c +1
-3@@ -294,7 +294,6 @@ static int mv_usb2_phy_probe(struct platform_device *pdev) {struct phy_provider *phy_provider;struct mv_usb2_phy *mv_phy; -struct resource *r; mv_phy =devm_kzalloc (&pdev->dev,sizeof (*mv_phy),GFP_KERNEL );if (!mv_phy)@@ -308,8 +307,7 @@ static int mv_usb2_phy_probe(struct platform_device *pdev)return PTR_ERR (mv_phy->clk); } - r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - mv_phy->base =devm_ioremap_resource (&pdev->dev, r); + mv_phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mv_phy->base))return PTR_ERR (mv_phy->base);drivers/phy/marvell/phy-pxa-usb.c +1
-4@@ -286,7 +286,6 @@ MODULE_DEVICE_TABLE(of, pxa_usb_phy_of_match);static int pxa_usb_phy_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *resource;struct pxa_usb_phy *pxa_usb_phy;struct phy_provider *provider;const struct of_device_id *of_id;@@ -301,8 +300,7 @@ static int pxa_usb_phy_probe(struct platform_device *pdev)else pxa_usb_phy->version =PXA_USB_PHY_MMP2 ; - resource =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - pxa_usb_phy->base =devm_ioremap_resource (dev, resource); + pxa_usb_phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (pxa_usb_phy->base)) {dev_err (dev,"failed to remap PHY regs\n" );return PTR_ERR (pxa_usb_phy->base); --2.18.0
_______________________________________________
linux-arm-kernel mailing list
[email protected]
Chunfeng Yun
maintainerPATCH v2 8/17 phy: phy-xgene: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: no changes
--- drivers/phy/phy-xgene.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/phy/phy-xgene.c +1 -3
@@ -1644,7 +1644,6 @@ static int xgene_phy_probe(struct platform_device *pdev) {struct phy_provider *phy_provider;struct xgene_phy_ctx *ctx; -struct resource *res;u32 default_spd[] =DEFAULT_SATA_SPD_SEL ;u32 default_txboost_gain[] =DEFAULT_SATA_TXBOOST_GAIN ;u32 default_txeye_direction[] =DEFAULT_SATA_TXEYEDIRECTION ;
@@ -1661,8 +1660,7 @@ static int xgene_phy_probe(struct platform_device *pdev) ctx->dev = &pdev->dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - ctx->sds_base =devm_ioremap_resource (&pdev->dev, res); + ctx->sds_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (ctx->sds_base))return PTR_ERR (ctx->sds_base);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 9/17 phy: phy-mtk-ufs: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: no changes
--- drivers/phy/mediatek/phy-mtk-ufs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/phy/mediatek/phy-mtk-ufs.c +1 -3
@@ -195,7 +195,6 @@ static int ufs_mtk_phy_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct phy *generic_phy;struct phy_provider *phy_provider; -struct resource *res;struct ufs_mtk_phy *phy;int ret;
@@ -203,8 +202,7 @@ static int ufs_mtk_phy_probe(struct platform_device *pdev)if (!phy)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy->mmio =devm_ioremap_resource (dev, res); + phy->mmio =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy->mmio))return PTR_ERR (phy->mmio);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 10/17 phy: qualcomm: convert to devm_platform_ioremap_resource(_byname)
In reply to Chunfeng YunUse devm_platform_ioremap_resource(_byname) to simplify code
---
v2: no changes
--- drivers/phy/qualcomm/phy-qcom-apq8064-sata.c | 4 +--- drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c | 4 +--- drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c | 4 +--- drivers/phy/qualcomm/phy-qcom-pcie2.c | 5 +---- drivers/phy/qualcomm/phy-qcom-qusb2.c | 4 +--- 5 files changed, 5 insertions(+), 16 deletions(-)
drivers/phy/qualcomm/phy-qcom-apq8064-sata.c +1 -3
@@ -201,7 +201,6 @@ static int qcom_apq8064_sata_phy_probe(struct platform_device *pdev) {struct qcom_apq8064_sata_phy *phy;struct device *dev = &pdev->dev; -struct resource *res;struct phy_provider *phy_provider;struct phy *generic_phy;int ret;
@@ -210,8 +209,7 @@ static int qcom_apq8064_sata_phy_probe(struct platform_device *pdev)if (!phy)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy->mmio =devm_ioremap_resource (dev, res); + phy->mmio =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy->mmio))return PTR_ERR (phy->mmio);
drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c +1 -3
@@ -95,7 +95,6 @@ MODULE_DEVICE_TABLE(of, ipq4019_usb_phy_of_match);static int ipq4019_usb_phy_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *res;struct phy_provider *phy_provider;struct ipq4019_usb_phy *phy;
@@ -104,8 +103,7 @@ static int ipq4019_usb_phy_probe(struct platform_device *pdev)return -ENOMEM ; phy->dev = &pdev->dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy->base =devm_ioremap_resource (&pdev->dev, res); + phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy->base)) {dev_err (dev,"failed to remap register memory\n" );return PTR_ERR (phy->base);
drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c +1 -3
@@ -128,7 +128,6 @@ static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev) {struct qcom_ipq806x_sata_phy *phy;struct device *dev = &pdev->dev; -struct resource *res;struct phy_provider *phy_provider;struct phy *generic_phy;int ret;
@@ -137,8 +136,7 @@ static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev)if (!phy)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy->mmio =devm_ioremap_resource (dev, res); + phy->mmio =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy->mmio))return PTR_ERR (phy->mmio);
drivers/phy/qualcomm/phy-qcom-pcie2.c +1 -4
@@ -250,7 +250,6 @@ static int qcom_pcie2_phy_probe(struct platform_device *pdev) {struct phy_provider *phy_provider;struct qcom_phy *qphy; -struct resource *res;struct device *dev = &pdev->dev;struct phy *phy;int ret;
@@ -260,9 +259,7 @@ static int qcom_pcie2_phy_probe(struct platform_device *pdev)return -ENOMEM ; qphy->dev = dev; - - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - qphy->base =devm_ioremap_resource (dev, res); + qphy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (qphy->base))return PTR_ERR (qphy->base);
drivers/phy/qualcomm/phy-qcom-qusb2.c +1 -3
@@ -844,7 +844,6 @@ static int qusb2_phy_probe(struct platform_device *pdev)struct qusb2_phy *qphy;struct phy_provider *phy_provider;struct phy *generic_phy; -struct resource *res;int ret, i;int num;u32 value;
@@ -855,8 +854,7 @@ static int qusb2_phy_probe(struct platform_device *pdev)return -ENOMEM ; or = &qphy->overrides; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - qphy->base =devm_ioremap_resource (dev, res); + qphy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (qphy->base))return PTR_ERR (qphy->base);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 11/17 phy: phy-ralink-usb: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: no changes
--- drivers/phy/ralink/phy-ralink-usb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/phy/ralink/phy-ralink-usb.c +1 -3
@@ -170,7 +170,6 @@ MODULE_DEVICE_TABLE(of, ralink_usb_phy_of_match);static int ralink_usb_phy_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *res;struct phy_provider *phy_provider;const struct of_device_id *match;struct ralink_usb_phy *phy;
@@ -194,8 +193,7 @@ static int ralink_usb_phy_probe(struct platform_device *pdev)/* The MT7628 and MT7688 require extra setup of PHY registers. */ if (of_device_is_compatible (dev->of_node,"mediatek,mt7628-usbphy" )) { - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy->base =devm_ioremap_resource (&pdev->dev, res); + phy->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy->base)) {dev_err (dev,"failed to remap register memory\n" );return PTR_ERR (phy->base);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 12/17 phy: renesas: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: no changes
--- drivers/phy/renesas/phy-rcar-gen2.c | 4 +--- drivers/phy/renesas/phy-rcar-gen3-pcie.c | 4 +--- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 4 +--- drivers/phy/renesas/phy-rcar-gen3-usb3.c | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-)
drivers/phy/renesas/phy-rcar-gen2.c +1 -3
@@ -339,7 +339,6 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev)struct rcar_gen2_phy_driver *drv;struct phy_provider *provider;struct device_node *np; -struct resource *res;void __iomem *base;struct clk *clk;const struct rcar_gen2_phy_data *data;
@@ -357,8 +356,7 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev)return PTR_ERR (clk); } - 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))return PTR_ERR (base);
drivers/phy/renesas/phy-rcar-gen3-pcie.c +1 -3
@@ -76,7 +76,6 @@ static int rcar_gen3_phy_pcie_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct phy_provider *provider;struct rcar_gen3_phy *phy; -struct resource *res;void __iomem *base;int error;
@@ -86,8 +85,7 @@ static int rcar_gen3_phy_pcie_probe(struct platform_device *pdev)return -EINVAL ; } - 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))return PTR_ERR (base);
drivers/phy/renesas/phy-rcar-gen3-usb2.c +1 -3
@@ -611,7 +611,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct rcar_gen3_chan *channel;struct phy_provider *provider; -struct resource *res;const struct phy_ops *phy_usb2_ops;int ret =0 , i;
@@ -624,8 +623,7 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)if (!channel)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - channel->base =devm_ioremap_resource (dev, res); + channel->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (channel->base))return PTR_ERR (channel->base);
drivers/phy/renesas/phy-rcar-gen3-usb3.c +1 -3
@@ -133,7 +133,6 @@ static int rcar_gen3_phy_usb3_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct rcar_gen3_usb3 *r;struct phy_provider *provider; -struct resource *res;int ret =0 ;struct clk *clk;
@@ -146,8 +145,7 @@ static int rcar_gen3_phy_usb3_probe(struct platform_device *pdev)if (!r)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - r->base =devm_ioremap_resource (dev, res); + r->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (r->base))return PTR_ERR (r->base);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 13/17 phy: rockchip: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: no changes
--- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +1 -3
@@ -1144,7 +1144,6 @@ static int inno_hdmi_phy_probe(struct platform_device *pdev) {struct inno_hdmi_phy *inno;struct phy_provider *phy_provider; -struct resource *res;void __iomem *regs;int ret;
@@ -1158,8 +1157,7 @@ static int inno_hdmi_phy_probe(struct platform_device *pdev)if (!inno->plat_data || !inno->plat_data->ops)return -EINVAL ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - regs =devm_ioremap_resource (inno->dev, res); + regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (regs))return PTR_ERR (regs);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 14/17 phy: samsung: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: add Reviewed-by Krzysztof
--- drivers/phy/samsung/phy-exynos-pcie.c | 7 ++----- drivers/phy/samsung/phy-exynos5-usbdrd.c | 4 +--- drivers/phy/samsung/phy-exynos5250-sata.c | 5 +---- drivers/phy/samsung/phy-samsung-usb2.c | 4 +--- 4 files changed, 5 insertions(+), 15 deletions(-)
drivers/phy/samsung/phy-exynos-pcie.c +2 -5
@@ -232,7 +232,6 @@ static int exynos_pcie_phy_probe(struct platform_device *pdev)struct exynos_pcie_phy *exynos_phy;struct phy *generic_phy;struct phy_provider *phy_provider; -struct resource *res;const struct exynos_pcie_phy_data *drv_data; drv_data =of_device_get_match_data (dev);
@@ -243,13 +242,11 @@ static int exynos_pcie_phy_probe(struct platform_device *pdev)if (!exynos_phy)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - exynos_phy->phy_base =devm_ioremap_resource (dev, res); + exynos_phy->phy_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (exynos_phy->phy_base))return PTR_ERR (exynos_phy->phy_base); - res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - exynos_phy->blk_base =devm_ioremap_resource (dev, res); + exynos_phy->blk_base =devm_platform_ioremap_resource (pdev,1 );if (IS_ERR (exynos_phy->blk_base))return PTR_ERR (exynos_phy->blk_base);
drivers/phy/samsung/phy-exynos5-usbdrd.c +1 -3
@@ -829,7 +829,6 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)struct device_node *node = dev->of_node;struct exynos5_usbdrd_phy *phy_drd;struct phy_provider *phy_provider; -struct resource *res;const struct exynos5_usbdrd_phy_drvdata *drv_data;struct regmap *reg_pmu;u32 pmu_offset;
@@ -843,8 +842,7 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)dev_set_drvdata (dev, phy_drd); phy_drd->dev = dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy_drd->reg_phy =devm_ioremap_resource (dev, res); + phy_drd->reg_phy =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy_drd->reg_phy))return PTR_ERR (phy_drd->reg_phy);
drivers/phy/samsung/phy-exynos5250-sata.c +1 -4
@@ -162,7 +162,6 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) {struct exynos_sata_phy *sata_phy;struct device *dev = &pdev->dev; -struct resource *res;struct phy_provider *phy_provider;struct device_node *node;int ret =0 ;
@@ -171,9 +170,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)if (!sata_phy)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - - sata_phy->regs =devm_ioremap_resource (dev, res); + sata_phy->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (sata_phy->regs))return PTR_ERR (sata_phy->regs);
drivers/phy/samsung/phy-samsung-usb2.c +1 -3
@@ -143,7 +143,6 @@ static int samsung_usb2_phy_probe(struct platform_device *pdev)const struct samsung_usb2_phy_config *cfg;struct device *dev = &pdev->dev;struct phy_provider *phy_provider; -struct resource *mem;struct samsung_usb2_phy_driver *drv;int i, ret;
@@ -167,8 +166,7 @@ static int samsung_usb2_phy_probe(struct platform_device *pdev) drv->cfg = cfg; drv->dev = dev; - mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - drv->reg_phy =devm_ioremap_resource (dev, mem); + drv->reg_phy =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (drv->reg_phy)) {dev_err (dev,"Failed to map register memory (phy)\n" );return PTR_ERR (drv->reg_phy);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 15/17 phy: phy-stm32-usbphyc: convert to devm_platform_ioremap_resource
In reply to Chunfeng YunUse devm_platform_ioremap_resource to simplify code
---
v2: add Reviewed-by Amelie
--- drivers/phy/st/phy-stm32-usbphyc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/phy/st/phy-stm32-usbphyc.c +1 -3
@@ -311,7 +311,6 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)struct stm32_usbphyc *usbphyc;struct device *dev = &pdev->dev;struct device_node *child, *np = dev->of_node; -struct resource *res;struct phy_provider *phy_provider;u32 version;int ret, port =0 ;
@@ -322,8 +321,7 @@ static int stm32_usbphyc_probe(struct platform_device *pdev) usbphyc->dev = dev;dev_set_drvdata (dev, usbphyc); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - usbphyc->base =devm_ioremap_resource (dev, res); + usbphyc->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (usbphyc->base))return PTR_ERR (usbphyc->base);
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 16/17 phy: tegra: convert to devm_platform_ioremap_resource(_byname)
In reply to Chunfeng YunUse devm_platform_ioremap_resource(_byname) to simplify code
---
v2: no changes
--- drivers/phy/tegra/phy-tegra194-p2u.c | 4 +--- drivers/phy/tegra/xusb.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/phy/tegra/phy-tegra194-p2u.c +1 -3
@@ -72,14 +72,12 @@ static int tegra_p2u_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct phy *generic_phy;struct tegra_p2u *phy; -struct resource *res; phy =devm_kzalloc (dev,sizeof (*phy),GFP_KERNEL );if (!phy)return -ENOMEM ; - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"ctl" ); - phy->base =devm_ioremap_resource (dev, res); + phy->base =devm_platform_ioremap_resource_byname (pdev,"ctl" );if (IS_ERR (phy->base))return PTR_ERR (phy->base);
drivers/phy/tegra/xusb.c +1 -3
@@ -1148,7 +1148,6 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)const struct tegra_xusb_padctl_soc *soc;struct tegra_xusb_padctl *padctl;const struct of_device_id *match; -struct resource *res;int err;/* for backwards compatibility with old device trees */
@@ -1173,8 +1172,7 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)INIT_LIST_HEAD (&padctl->pads);mutex_init (&padctl->lock); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - padctl->regs =devm_ioremap_resource (&pdev->dev, res); + padctl->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (padctl->regs)) { err =PTR_ERR (padctl->regs); goto remove;
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH v2 17/17 phy: ti: convert to devm_platform_ioremap_resource(_byname)
In reply to Chunfeng YunUse devm_platform_ioremap_resource(_byname) to simplify code
---
v2: no changes
--- drivers/phy/ti/phy-omap-control.c | 17 ++++++----------- drivers/phy/ti/phy-omap-usb2.c | 4 +--- drivers/phy/ti/phy-ti-pipe3.c | 15 ++++----------- 3 files changed, 11 insertions(+), 25 deletions(-)
drivers/phy/ti/phy-omap-control.c +6 -11
@@ -268,7 +268,6 @@ MODULE_DEVICE_TABLE(of, omap_control_phy_id_table);static int omap_control_phy_probe (struct platform_device *pdev) { -struct resource *res;const struct of_device_id *of_id;struct omap_control_phy *control_phy;
@@ -285,16 +284,13 @@ static int omap_control_phy_probe(struct platform_device *pdev) control_phy->type = *(enum omap_control_phy_type *)of_id->data;if (control_phy->type ==OMAP_CTRL_TYPE_OTGHS ) { - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"otghs_control" ); - control_phy->otghs_control =devm_ioremap_resource ( - &pdev->dev, res); + control_phy->otghs_control = +devm_platform_ioremap_resource_byname (pdev,"otghs_control" );if (IS_ERR (control_phy->otghs_control))return PTR_ERR (control_phy->otghs_control); }else { - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"power" ); - control_phy->power =devm_ioremap_resource (&pdev->dev, res); + control_phy->power = +devm_platform_ioremap_resource_byname (pdev,"power" );if (IS_ERR (control_phy->power)) {dev_err (&pdev->dev,"Couldn't get power register\n" );return PTR_ERR (control_phy->power);
@@ -312,9 +308,8 @@ static int omap_control_phy_probe(struct platform_device *pdev) }if (control_phy->type ==OMAP_CTRL_TYPE_PCIE ) { - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"pcie_pcs" ); - control_phy->pcie_pcs =devm_ioremap_resource (&pdev->dev, res); + control_phy->pcie_pcs = +devm_platform_ioremap_resource_byname (pdev,"pcie_pcs" );if (IS_ERR (control_phy->pcie_pcs))return PTR_ERR (control_phy->pcie_pcs); }
drivers/phy/ti/phy-omap-usb2.c +1 -3
@@ -366,7 +366,6 @@ static int omap_usb2_probe(struct platform_device *pdev) {struct omap_usb *phy;struct phy *generic_phy; -struct resource *res;struct phy_provider *phy_provider;struct usb_otg *otg;struct device_node *node = pdev->dev.of_node;
@@ -403,8 +402,7 @@ static int omap_usb2_probe(struct platform_device *pdev)omap_usb2_init_errata (phy); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - phy->phy_base =devm_ioremap_resource (&pdev->dev, res); + phy->phy_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (phy->phy_base))return PTR_ERR (phy->phy_base);
drivers/phy/ti/phy-ti-pipe3.c +4 -11
@@ -745,35 +745,28 @@ static int ti_pipe3_get_sysctrl(struct ti_pipe3 *phy)static int ti_pipe3_get_tx_rx_base (struct ti_pipe3 *phy) { -struct resource *res;struct device *dev = phy->dev;struct platform_device *pdev =to_platform_device (dev); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"phy_rx" ); - phy->phy_rx =devm_ioremap_resource (dev, res); + phy->phy_rx =devm_platform_ioremap_resource_byname (pdev,"phy_rx" );if (IS_ERR (phy->phy_rx))return PTR_ERR (phy->phy_rx); - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"phy_tx" ); - phy->phy_tx =devm_ioremap_resource (dev, res); + phy->phy_tx =devm_platform_ioremap_resource_byname (pdev,"phy_tx" );return PTR_ERR_OR_ZERO (phy->phy_tx); }static int ti_pipe3_get_pll_base (struct ti_pipe3 *phy) { -struct resource *res;struct device *dev = phy->dev;struct platform_device *pdev =to_platform_device (dev);if (phy->mode ==PIPE3_MODE_PCIE )return 0 ; - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , -"pll_ctrl" ); - phy->pll_ctrl_base =devm_ioremap_resource (dev, res); + phy->pll_ctrl_base = +devm_platform_ioremap_resource_byname (pdev,"pll_ctrl" );return PTR_ERR_OR_ZERO (phy->pll_ctrl_base); }
Signature · 1 line
2.18.0
Quoted 1 line · Chunfeng Yun
Use
devm_platform_ioremap_resource(_byname)to simplify code
Applied all, thanks
Signature · 6 lines
~Vinod _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic