soc: sunxi: convert to devm_platform_ioremap_resource
Subsystems (11)
PATCH 1/10 soc: sunxi: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/sunxi/sunxi_sram.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/soc/sunxi/sunxi_sram.c +1 -3
@@ -320,7 +320,6 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = {static int sunxi_sram_probe (struct platform_device *pdev) { -struct resource *res;struct dentry *d;struct regmap *emac_clock;const struct sunxi_sramc_variant *variant;
@@ -331,8 +330,7 @@ static int sunxi_sram_probe(struct platform_device *pdev)if (!variant)return -EINVAL ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return PTR_ERR (base);
Signature · 1 line
2.17.1
PATCH 2/10 soc: samsung: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/samsung/exynos-pmu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/soc/samsung/exynos-pmu.c +1 -3
@@ -110,10 +110,8 @@ EXPORT_SYMBOL_GPL(exynos_get_pmu_regmap);static int exynos_pmu_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *res; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - pmu_base_addr =devm_ioremap_resource (dev, res); + pmu_base_addr =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (pmu_base_addr))return PTR_ERR (pmu_base_addr);
Signature · 1 line
2.17.1
Re: [PATCH 02/10] soc: samsung: convert to devm_platform_ioremap_resource
Quoted 5 lines · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>--- drivers/soc/samsung/exynos-pmu.c | 4 +---
Thanks, applied.
Best regards,
Krzysztof
PATCH 3/10 soc: amlogic: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/amlogic/meson-canvas.c | 4 +--- drivers/soc/amlogic/meson-clk-measure.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/soc/amlogic/meson-canvas.c +1 -3
@@ -166,7 +166,6 @@ EXPORT_SYMBOL_GPL(meson_canvas_free);static int meson_canvas_probe (struct platform_device *pdev) { -struct resource *res;struct meson_canvas *canvas;struct device *dev = &pdev->dev;
@@ -174,8 +173,7 @@ static int meson_canvas_probe(struct platform_device *pdev)if (!canvas)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - canvas->reg_base =devm_ioremap_resource (dev, res); + canvas->reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (canvas->reg_base))return PTR_ERR (canvas->reg_base);
drivers/soc/amlogic/meson-clk-measure.c +1 -3
@@ -605,7 +605,6 @@ static int meson_msr_probe(struct platform_device *pdev) {const struct meson_msr_id *match_data;struct meson_msr *priv; -struct resource *res;struct dentry *root, *clks;void __iomem *base;int i;
@@ -623,8 +622,7 @@ static int meson_msr_probe(struct platform_device *pdev)memcpy (priv->msr_table, match_data,sizeof (priv->msr_table)); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base)) {dev_err (&pdev->dev,"io resource mapping failed\n" );return PTR_ERR (base);
Signature · 1 line
2.17.1
PATCH 4/10 soc: zte: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/zte/zx2967_pm_domains.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/soc/zte/zx2967_pm_domains.c +1 -3
@@ -113,7 +113,6 @@ int zx2967_pd_probe(struct platform_device *pdev, int domain_num) {struct genpd_onecell_data *genpd_data; -struct resource *res;int i; genpd_data =devm_kzalloc (&pdev->dev,sizeof (*genpd_data),GFP_KERNEL );
@@ -123,8 +122,7 @@ int zx2967_pd_probe(struct platform_device *pdev, genpd_data->domains = zx_pm_domains; genpd_data->num_domains = domain_num; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - pcubase =devm_ioremap_resource (&pdev->dev, res); + pcubase =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (pcubase))return PTR_ERR (pcubase);
Signature · 1 line
2.17.1
PATCH 5/10 soc: fsl: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/fsl/guts.c | 4 +--- drivers/soc/fsl/rcpm.c | 7 +------ 2 files changed, 2 insertions(+), 9 deletions(-)
drivers/soc/fsl/guts.c +1 -3
@@ -140,7 +140,6 @@ static int fsl_guts_probe(struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node;struct device *dev = &pdev->dev; -struct resource *res;const struct fsl_soc_die_attr *soc_die;const char *machine;u32 svr;
@@ -152,8 +151,7 @@ static int fsl_guts_probe(struct platform_device *pdev) guts->little_endian =of_property_read_bool (np,"little-endian" ); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - guts->regs =devm_ioremap_resource (dev, res); + guts->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (guts->regs))return PTR_ERR (guts->regs);
drivers/soc/fsl/rcpm.c +1 -6
@@ -102,7 +102,6 @@ static const struct dev_pm_ops rcpm_pm_ops = {static int rcpm_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *r;struct rcpm *rcpm;int ret;
@@ -110,11 +109,7 @@ static int rcpm_probe(struct platform_device *pdev)if (!rcpm)return -ENOMEM ; - r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!r) -return -ENODEV ; - - rcpm->ippdexpcr_base =devm_ioremap_resource (&pdev->dev, r); + rcpm->ippdexpcr_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (rcpm->ippdexpcr_base)) { ret =PTR_ERR (rcpm->ippdexpcr_base);return ret;
Signature · 1 line
2.17.1
PATCH 6/10 soc: mediatek: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/mediatek/mtk-scpsys.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/soc/mediatek/mtk-scpsys.c +1 -3
@@ -425,7 +425,6 @@ static struct scp *init_scp(struct platform_device *pdev, bool bus_prot_reg_update) {struct genpd_onecell_data *pd_data; -struct resource *res;int i, j;struct scp *scp;struct clk *clk[CLK_MAX ];
@@ -441,8 +440,7 @@ static struct scp *init_scp(struct platform_device *pdev, scp->dev = &pdev->dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - scp->base =devm_ioremap_resource (&pdev->dev, res); + scp->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (scp->base))return ERR_CAST (scp->base);
Signature · 1 line
2.17.1
PATCH 7/10 soc: ti: wkup_m3_ipc: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/ti/wkup_m3_ipc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/soc/ti/wkup_m3_ipc.c +1 -3
@@ -429,7 +429,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)int irq, ret;phandle rproc_phandle;struct rproc *m3_rproc; -struct resource *res;struct task_struct *task;struct wkup_m3_ipc *m3_ipc;
@@ -437,8 +436,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)if (!m3_ipc)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - m3_ipc->ipc_mem_base =devm_ioremap_resource (dev, res); + m3_ipc->ipc_mem_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (m3_ipc->ipc_mem_base)) {dev_err (dev,"could not ioremap ipc_mem\n" );return PTR_ERR (m3_ipc->ipc_mem_base);
Signature · 1 line
2.17.1
PATCH 8/10 soc: lantiq: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/lantiq/fpi-bus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/soc/lantiq/fpi-bus.c +1 -3
@@ -28,14 +28,12 @@ static int ltq_fpi_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct device_node *np = dev->of_node; -struct resource *res_xbar;struct regmap *rcu_regmap;void __iomem *xbar_membase;u32 rcu_ahb_endianness_reg_offset;int ret; - res_xbar =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - xbar_membase =devm_ioremap_resource (dev, res_xbar); + xbar_membase =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (xbar_membase))return PTR_ERR (xbar_membase);
Signature · 1 line
2.17.1
Paul Burton
AppliedRe: [PATCH 08/10] soc: lantiq: convert to devm_platform_ioremap_resource
Hello,
Quoted 1 line · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.
Applied to mips-next.
Quoted 5 lines
commit
23c25c732530
https://git.kernel.org/mips/c/23c25c732530Signed-off-by Yangtao Li <[email protected]>Signed-off-by Paul Burton <[email protected]>
Thanks,
Paul
[ This message was auto-generated; if you believe anything is incorrect
then please email [email protected] to report it. ]
PATCH 9/10 soc: ixp4xx: qmgr: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/ixp4xx/ixp4xx-qmgr.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/soc/ixp4xx/ixp4xx-qmgr.c +1 -5
@@ -375,13 +375,9 @@ static int ixp4xx_qmgr_probe(struct platform_device *pdev)int i, err;irq_handler_t handler1, handler2;struct device *dev = &pdev->dev; -struct resource *res;int irq1, irq2; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) -return -ENODEV ; - qmgr_regs =devm_ioremap_resource (dev, res); + qmgr_regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (qmgr_regs))return PTR_ERR (qmgr_regs);
Signature · 1 line
2.17.1
PATCH 10/10 soc: qcom: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/soc/qcom/llcc-qcom.c | 7 +------ drivers/soc/qcom/qcom-geni-se.c | 4 +--- drivers/soc/qcom/qcom_aoss.c | 4 +--- drivers/soc/qcom/qcom_gsbi.c | 5 +---- drivers/soc/qcom/spm.c | 4 +--- 5 files changed, 5 insertions(+), 19 deletions(-)
drivers/soc/qcom/llcc-qcom.c +1 -6
@@ -387,7 +387,6 @@ static int qcom_llcc_remove(struct platform_device *pdev)static struct regmap *qcom_llcc_init_mmio (struct platform_device *pdev,const char *name) { -struct resource *res;void __iomem *base;struct regmap_config llcc_regmap_config = { .reg_bits =32 ,
@@ -396,11 +395,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, .fast_io = true, }; - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , name); -if (!res) -return ERR_PTR (-ENODEV ); - - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return ERR_CAST (base);
drivers/soc/qcom/qcom-geni-se.c +1 -3
@@ -723,7 +723,6 @@ EXPORT_SYMBOL(geni_se_rx_dma_unprep);static int geni_se_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *res;struct geni_wrapper *wrapper;int ret;
@@ -732,8 +731,7 @@ static int geni_se_probe(struct platform_device *pdev)return -ENOMEM ; wrapper->dev = dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - wrapper->base =devm_ioremap_resource (dev, res); + wrapper->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (wrapper->base))return PTR_ERR (wrapper->base);
drivers/soc/qcom/qcom_aoss.c +1 -3
@@ -513,7 +513,6 @@ static void qmp_cooling_devices_remove(struct qmp *qmp)static int qmp_probe (struct platform_device *pdev) { -struct resource *res;struct qmp *qmp;int irq;int ret;
@@ -526,8 +525,7 @@ static int qmp_probe(struct platform_device *pdev)init_waitqueue_head (&qmp->event);mutex_init (&qmp->tx_lock); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - qmp->msgram =devm_ioremap_resource (&pdev->dev, res); + qmp->msgram =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (qmp->msgram))return PTR_ERR (qmp->msgram);
drivers/soc/qcom/qcom_gsbi.c +1 -4
@@ -127,7 +127,6 @@ static int gsbi_probe(struct platform_device *pdev)struct device_node *node = pdev->dev.of_node;struct device_node *tcsr_node;const struct of_device_id *match; -struct resource *res;void __iomem *base;struct gsbi_info *gsbi;int i, ret;
@@ -135,12 +134,10 @@ static int gsbi_probe(struct platform_device *pdev)const struct crci_config *config =NULL ; gsbi =devm_kzalloc (&pdev->dev,sizeof (*gsbi),GFP_KERNEL ); -if (!gsbi)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return PTR_ERR (base);
drivers/soc/qcom/spm.c +1 -3
@@ -320,7 +320,6 @@ static const struct of_device_id spm_match_table[] = {static int spm_dev_probe (struct platform_device *pdev) {struct spm_driver_data *drv; -struct resource *res;const struct of_device_id *match_id;void __iomem *addr;int cpu;
@@ -329,8 +328,7 @@ static int spm_dev_probe(struct platform_device *pdev)if (!drv)return -EINVAL ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - drv->reg_base =devm_ioremap_resource (&pdev->dev, res); + drv->reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (drv->reg_base))return PTR_ERR (drv->reg_base);
Signature · 1 line
2.17.1
Re: [PATCH 10/10] soc: qcom: convert to devm_platform_ioremap_resource
Quoted 24 lines · On Sat, 14 Dec 2019 17:54:47 +0000 Yangtao Li <[email protected]> wrote:
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>--- drivers/soc/qcom/llcc-qcom.c | 7 +------ drivers/soc/qcom/qcom-geni-se.c | 4 +--- drivers/soc/qcom/qcom_aoss.c | 4 +--- drivers/soc/qcom/qcom_gsbi.c | 5 +---- drivers/soc/qcom/spm.c | 4 +--- 5 files changed, 5 insertions(+), 19 deletions(-)drivers/soc/qcom/llcc-qcom.c +0
-1@@ -387,7 +387,6 @@ static int qcom_llcc_remove(struct platform_device *pdev)static struct regmap *qcom_llcc_init_mmio (struct platform_device *pdev,const char *name) { -struct resource *res;void __iomem *base;struct regmap_config llcc_regmap_config = { .reg_bits =32 ,
drivers/soc/qcom/llcc-qcom.c static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, · line 398
Quoted 9 lines
drivers/soc/qcom/llcc-qcom.c +1
-5@@ -396,11 +395,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, .fast_io = true, }; - res =platform_get_resource_byname (pdev,IORESOURCE_MEM , name); -if (!res) -return ERR_PTR (-ENODEV ); - - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );
What guarantees do you have that entry 0 matches name?
I find these changes pointless: they don't add much to the readability or maintainability of the code, and instead introduce creative bugs.
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Re: [PATCH 10/10] soc: qcom: convert to devm_platform_ioremap_resource
Quoted 31 lines · Marc Zyngier
Quoted 27 lines · On Sat, 14 Dec 2019 17:54:47 +0000 Yangtao Li <[email protected]> wrote:
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>--- drivers/soc/qcom/llcc-qcom.c | 7 +------ drivers/soc/qcom/qcom-geni-se.c | 4 +--- drivers/soc/qcom/qcom_aoss.c | 4 +--- drivers/soc/qcom/qcom_gsbi.c | 5 +---- drivers/soc/qcom/spm.c | 4 +--- 5 files changed, 5 insertions(+), 19 deletions(-)drivers/soc/qcom/llcc-qcom.c +0
-1@@ -387,7 +387,6 @@ static int qcom_llcc_remove(struct platform_device *pdev)static struct regmap *qcom_llcc_init_mmio (struct platform_device *pdev,const char *name) { -struct resource *res;void __iomem *base;struct regmap_config llcc_regmap_config = { .reg_bits =32 ,@@ -396,11 +395,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, .fast_io = true, };
Quoted 8 lines
drivers/soc/qcom/llcc-qcom.c static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, · line 398
Quoted 6 lines
drivers/soc/qcom/llcc-qcom.c +1
-5- res =platform_get_resource_byname (pdev,IORESOURCE_MEM , name); -if (!res) -return ERR_PTR (-ENODEV ); - - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );What guarantees do you have that entry 0 matches name?
Yeah, this place is wrong. I intruduce another helper.
https://lore.kernel.org/patchwork/patch/1165186/
Thx,
Yangtao
Quoted 7 lines
I find these changes pointless: they don't add much to the readability or maintainability of the code, and instead introduce creative bugs.
M.--
Jazz is not dead. It just smells funny...
Quoted 4 lines · Yangtao Li
Use
devm_platform_ioremap_resource()to simplify code.Signed-off-by Yangtao Li <[email protected]>
Quoted 29 lines
--- drivers/soc/sunxi/sunxi_sram.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/soc/sunxi/sunxi_sram.c +1
-4@@ -320,7 +320,6 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = {static int sunxi_sram_probe (struct platform_device *pdev) { -struct resource *res;struct dentry *d;struct regmap *emac_clock;const struct sunxi_sramc_variant *variant;@@ -331,8 +330,7 @@ static int sunxi_sram_probe(struct platform_device *pdev)if (!variant)return -EINVAL ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return PTR_ERR (base); --2.17.1