Skip to contentSkip to conversation

mailbox: altera: convert to devm_platform_ioremap_resource

PATCH In review Yangtao Li 7 participants 19 messages Dec 28, 2019 – Jan 8, 2020

Subsystems (9)
lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/13 mailbox: altera: convert to devm_platform_ioremap_resource

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/mailbox-altera.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mailbox/mailbox-altera.c +1 -4
index 75282666fb06..afb320e9d69c 100644
@@ -285,7 +285,6 @@ static const struct mbox_chan_ops altera_mbox_ops = {
 static int altera_mbox_probe(struct platform_device *pdev)
 {
 	struct altera_mbox *mbox;
-	struct resource	*regs;
 	struct mbox_chan *chans;
 	int ret;
 
@@ -299,9 +298,7 @@ static int altera_mbox_probe(struct platform_device *pdev)
 	if (!chans)
 		return -ENOMEM;
 
-	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	mbox->mbox_base = devm_ioremap_resource(&pdev->dev, regs);
+	mbox->mbox_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mbox->mbox_base))
 		return PTR_ERR(mbox->mbox_base);
 
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/13 mailbox: xgene-slimpro: do some cleanup

Use devm_platform_ioremap_resource() to simplify code. 'i' and 'rc' are variables of the same type and there is no need to use two lines.

---
 drivers/mailbox/mailbox-xgene-slimpro.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mailbox/mailbox-xgene-slimpro.c +2 -5
index de260799f1b9..908c0eb99b5a 100644
@@ -170,10 +170,8 @@ static const struct mbox_chan_ops slimpro_mbox_ops = {
 static int slimpro_mbox_probe(struct platform_device *pdev)
 {
 	struct slimpro_mbox *ctx;
-	struct resource *regs;
 	void __iomem *mb_base;
-	int rc;
-	int i;
+	int rc, i;
 
 	ctx = devm_kzalloc(&pdev->dev, sizeof(struct slimpro_mbox), GFP_KERNEL);
 	if (!ctx)
@@ -181,8 +179,7 @@ static int slimpro_mbox_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, ctx);
 
-	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mb_base = devm_ioremap_resource(&pdev->dev, regs);
+	mb_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mb_base))
 		return PTR_ERR(mb_base);
 
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 3/13 mailbox: qcom-apcs: convert to devm_platform_ioremap_resource

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/qcom-apcs-ipc-mailbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/qcom-apcs-ipc-mailbox.c +1 -3
index eeebafd546e5..0faf69137780 100644
@@ -49,7 +49,6 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
 {
 	struct qcom_apcs_ipc *apcs;
 	struct regmap *regmap;
-	struct resource *res;
 	unsigned long offset;
 	void __iomem *base;
 	unsigned long i;
@@ -64,8 +63,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
 	if (!apcs)
 		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);
 
Signature · 1 line
2.17.1
Reviewed-by on v1 3/13
#3 lore raw

Re: [PATCH 03/13] mailbox: qcom-apcs: convert to devm_platform_ioremap_resource

Quoted 3 lines · Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Quoted 29 lines
---
 drivers/mailbox/qcom-apcs-ipc-mailbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/qcom-apcs-ipc-mailbox.c +1 -3
index eeebafd546e5..0faf69137780 100644
@@ -49,7 +49,6 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
 {
 	struct qcom_apcs_ipc *apcs;
 	struct regmap *regmap;
-	struct resource *res;
 	unsigned long offset;
 	void __iomem *base;
 	unsigned long i;
@@ -64,8 +63,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
 	if (!apcs)
 		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);
 
Signature · 1 line
2.17.1
author
#4 lore raw

PATCH 4/13 mailbox: mediatek: cmdq: convert to devm_platform_ioremap_resource

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/mtk-cmdq-mailbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/mtk-cmdq-mailbox.c +1 -3
index 9a6ce9f5a7db..7f9e34b021c8 100644
@@ -458,7 +458,6 @@ static struct mbox_chan *cmdq_xlate(struct mbox_controller *mbox,
 static int cmdq_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	struct cmdq *cmdq;
 	int err, i;
 
@@ -466,8 +465,7 @@ static int cmdq_probe(struct platform_device *pdev)
 	if (!cmdq)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	cmdq->base = devm_ioremap_resource(dev, res);
+	cmdq->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(cmdq->base)) {
 		dev_err(dev, "failed to ioremap gce\n");
 		return PTR_ERR(cmdq->base);
Signature · 1 line
2.17.1
Reviewed-by on v1 4/13
#5 lore raw

Re: [PATCH 04/13] mailbox: mediatek: cmdq: convert to devm_platform_ioremap_resource

Hi, Yangtao:

Quoted 2 lines · Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Quoted 27 lines
---
 drivers/mailbox/mtk-cmdq-mailbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/mtk-cmdq-mailbox.c +1 -3
index 9a6ce9f5a7db..7f9e34b021c8 100644
@@ -458,7 +458,6 @@ static struct mbox_chan *cmdq_xlate(struct mbox_controller *mbox,
 static int cmdq_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	struct cmdq *cmdq;
 	int err, i;
 
@@ -466,8 +465,7 @@ static int cmdq_probe(struct platform_device *pdev)
 	if (!cmdq)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	cmdq->base = devm_ioremap_resource(dev, res);
+	cmdq->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(cmdq->base)) {
 		dev_err(dev, "failed to ioremap gce\n");
 		return PTR_ERR(cmdq->base);
author
#6 lore raw

PATCH 5/13 mailbox: bcm2835: convert to devm_platform_ioremap_resource

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/bcm2835-mailbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/bcm2835-mailbox.c +1 -3
index 39761d190545..79f93c9c7682 100644
@@ -137,7 +137,6 @@ static int bcm2835_mbox_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	int ret = 0;
-	struct resource *iomem;
 	struct bcm2835_mbox *mbox;
 
 	mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
@@ -153,8 +152,7 @@ static int bcm2835_mbox_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mbox->regs = devm_ioremap_resource(&pdev->dev, iomem);
+	mbox->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mbox->regs)) {
 		ret = PTR_ERR(mbox->regs);
 		dev_err(&pdev->dev, "Failed to remap mailbox regs: %d\n", ret);
Signature · 1 line
2.17.1
Reviewed-by on v1 5/13
#7 lore raw

Re: [PATCH 05/13] mailbox: bcm2835: convert to devm_platform_ioremap_resource

Quoted 4 lines · Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---

Thanks!

Quoted 28 lines
 drivers/mailbox/bcm2835-mailbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/bcm2835- renamed from drivers/mailbox/bcm2835-mailbox.c +0 -0

mailbox.c
index 39761d190545..79f93c9c7682 100644

drivers/mailbox/bcm2835-mailbox.c +0 -1
@@ -137,7 +137,6 @@ static int bcm2835_mbox_probe(struct platform_device
 *pdev)
 {
 	struct device *dev = &pdev->dev;
 	int ret = 0;
-	struct resource *iomem;
 	struct bcm2835_mbox *mbox;
 
drivers/mailbox/bcm2835-mailbox.c +1 -2
 	mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
@@ -153,8 +152,7 @@ static int bcm2835_mbox_probe(struct platform_device
 *pdev)
 		return -ENODEV;
 	}
 
-	iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mbox->regs = devm_ioremap_resource(&pdev->dev, iomem);
+	mbox->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mbox->regs)) {
 		ret = PTR_ERR(mbox->regs);

dev_err(&pdev->dev, "Failed to remap mailbox regs: %d\n", ret);

author
#8 lore raw

PATCH 6/13 mailbox: hi3660: convert to devm_platform_ioremap_resource

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/hi3660-mailbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/hi3660-mailbox.c +1 -3
index 53f4bc2488c5..97e2c4ed807d 100644
@@ -240,7 +240,6 @@ static int hi3660_mbox_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct hi3660_mbox *mbox;
 	struct mbox_chan *chan;
-	struct resource *res;
 	unsigned long ch;
 	int err;
 
@@ -248,8 +247,7 @@ static int hi3660_mbox_probe(struct platform_device *pdev)
 	if (!mbox)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mbox->base = devm_ioremap_resource(dev, res);
+	mbox->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mbox->base))
 		return PTR_ERR(mbox->base);
 
Signature · 1 line
2.17.1
Reviewed-by on v1 6/13
#9 lore raw

Re: [PATCH 06/13] mailbox: hi3660: convert to devm_platform_ioremap_resource

Quoted 3 lines · Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Quoted 29 lines
---
 drivers/mailbox/hi3660-mailbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/hi3660-mailbox.c +1 -3
index 53f4bc2488c5..97e2c4ed807d 100644
@@ -240,7 +240,6 @@ static int hi3660_mbox_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct hi3660_mbox *mbox;
 	struct mbox_chan *chan;
-	struct resource *res;
 	unsigned long ch;
 	int err;
 
@@ -248,8 +247,7 @@ static int hi3660_mbox_probe(struct platform_device *pdev)
 	if (!mbox)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mbox->base = devm_ioremap_resource(dev, res);
+	mbox->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mbox->base))
 		return PTR_ERR(mbox->base);
 
Signature · 1 line
2.17.1
author
#10 lore raw

PATCH 7/13 mailbox: platform-mhu: convert to devm_platform_ioremap_resource

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/platform_mhu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/platform_mhu.c +1 -3
index b6e34952246b..a5922ac0b0bf 100644
@@ -117,7 +117,6 @@ static int platform_mhu_probe(struct platform_device *pdev)
 	int i, err;
 	struct platform_mhu *mhu;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	int platform_mhu_reg[MHU_CHANS] = {
 		MHU_SEC_OFFSET, MHU_LP_OFFSET, MHU_HP_OFFSET
 	};
@@ -127,8 +126,7 @@ static int platform_mhu_probe(struct platform_device *pdev)
 	if (!mhu)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mhu->base = devm_ioremap_resource(dev, res);
+	mhu->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mhu->base)) {
 		dev_err(dev, "ioremap failed\n");
 		return PTR_ERR(mhu->base);
Signature · 1 line
2.17.1
author
#11 lore raw

PATCH 8/13 mailbox: stm32-ipcc: convert to devm_platform_ioremap_resource

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/stm32-ipcc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/stm32-ipcc.c +1 -3
index ef966887aa15..0a7e9ce0fb31 100644
@@ -205,7 +205,6 @@ static int stm32_ipcc_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct stm32_ipcc *ipcc;
-	struct resource *res;
 	unsigned int i;
 	int ret;
 	u32 ip_ver;
@@ -235,8 +234,7 @@ static int stm32_ipcc_probe(struct platform_device *pdev)
 	}
 
 	/* regs */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ipcc->reg_base = devm_ioremap_resource(dev, res);
+	ipcc->reg_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(ipcc->reg_base))
 		return PTR_ERR(ipcc->reg_base);
 
Signature · 1 line
2.17.1
author
#12 lore raw

PATCH 9/13 mailbox: sti: do some cleanup

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code. 'irq' and 'ret' are variables of the same type and there is no need to use two lines.

---
 drivers/mailbox/mailbox-sti.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mailbox/mailbox-sti.c +2 -5
index 2baf69a0b81c..2a2316dfdca0 100644
@@ -408,9 +408,7 @@ static int sti_mbox_probe(struct platform_device *pdev)
 	struct sti_mbox_device *mdev;
 	struct device_node *np = pdev->dev.of_node;
 	struct mbox_chan *chans;
-	struct resource *res;
-	int irq;
-	int ret;
+	int irq, ret;
 
 	match = of_match_device(sti_mailbox_match, &pdev->dev);
 	if (!match) {
@@ -425,8 +423,7 @@ static int sti_mbox_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, mdev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mdev->base = devm_ioremap_resource(&pdev->dev, res);
+	mdev->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mdev->base))
 		return PTR_ERR(mdev->base);
 
Signature · 1 line
2.17.1
author
#13 lore raw

PATCH 10/13 mailbox: tegra: convert to devm_platform_ioremap_resource

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/tegra-hsp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mailbox/tegra-hsp.c +1 -3
index 834b35dc3b13..6d16e56942ff 100644
@@ -631,7 +631,6 @@ static int tegra_hsp_request_shared_irq(struct tegra_hsp *hsp)
 static int tegra_hsp_probe(struct platform_device *pdev)
 {
 	struct tegra_hsp *hsp;
-	struct resource *res;
 	unsigned int i;
 	u32 value;
 	int err;
@@ -645,8 +644,7 @@ static int tegra_hsp_probe(struct platform_device *pdev)
 	INIT_LIST_HEAD(&hsp->doorbells);
 	spin_lock_init(&hsp->lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	hsp->regs = devm_ioremap_resource(&pdev->dev, res);
+	hsp->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(hsp->regs))
 		return PTR_ERR(hsp->regs);
 
Signature · 1 line
2.17.1
author
#14 lore raw

PATCH 11/13 mailbox: hi6220: convert to devm_platform_ioremap_resource

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/hi6220-mailbox.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mailbox/hi6220-mailbox.c +2 -5
index cc236ac7a0b5..d9140a016170 100644
@@ -264,7 +264,6 @@ static int hi6220_mbox_probe(struct platform_device *pdev)
 	struct device_node *node = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
 	struct hi6220_mbox *mbox;
-	struct resource *res;
 	int i, err;
 
 	mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
@@ -287,15 +286,13 @@ static int hi6220_mbox_probe(struct platform_device *pdev)
 	if (mbox->irq < 0)
 		return mbox->irq;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mbox->ipc = devm_ioremap_resource(dev, res);
+	mbox->ipc = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mbox->ipc)) {
 		dev_err(dev, "ioremap ipc failed\n");
 		return PTR_ERR(mbox->ipc);
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	mbox->base = devm_ioremap_resource(dev, res);
+	mbox->base = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(mbox->base)) {
 		dev_err(dev, "ioremap buffer failed\n");
 		return PTR_ERR(mbox->base);
Signature · 1 line
2.17.1
author
#15 lore raw

PATCH 12/13 mailbox: omap: do some cleanup

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code. 'i' and 'ret' are variables of the same type and there is no need to use two lines.

---
 drivers/mailbox/omap-mailbox.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mailbox/omap-mailbox.c +2 -5
index 5978a35aac6d..9b9994be5602 100644
@@ -695,8 +695,7 @@ static struct mbox_chan *omap_mbox_of_xlate(struct mbox_controller *controller,
 
 static int omap_mbox_probe(struct platform_device *pdev)
 {
-	struct resource *mem;
-	int ret;
+	int ret, i;
 	struct mbox_chan *chnls;
 	struct omap_mbox **list, *mbox, *mboxblk;
 	struct omap_mbox_fifo_info *finfo, *finfoblk;
@@ -709,7 +708,6 @@ static int omap_mbox_probe(struct platform_device *pdev)
 	u32 num_users, num_fifos;
 	u32 tmp[3];
 	u32 l;
-	int i;
 
 	if (!node) {
 		pr_err("%s: only DT-based devices are supported\n", __func__);
@@ -772,8 +770,7 @@ static int omap_mbox_probe(struct platform_device *pdev)
 	if (!mdev)
 		return -ENOMEM;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mdev->mbox_base = devm_ioremap_resource(&pdev->dev, mem);
+	mdev->mbox_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mdev->mbox_base))
 		return PTR_ERR(mdev->mbox_base);
 
Signature · 1 line
2.17.1
author
#16 lore raw

PATCH 13/13 mailbox: armada-37xx-rwtm: convert to devm_platform_ioremap_resource

In reply to Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/mailbox/armada-37xx-rwtm-mailbox.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mailbox/armada-37xx-rwtm-mailbox.c +1 -4
index 19f086716dc5..02b7b28e6969 100644
@@ -143,7 +143,6 @@ static const struct mbox_chan_ops a37xx_mbox_ops = {
 static int armada_37xx_mbox_probe(struct platform_device *pdev)
 {
 	struct a37xx_mbox *mbox;
-	struct resource *regs;
 	struct mbox_chan *chans;
 	int ret;
 
@@ -156,9 +155,7 @@ static int armada_37xx_mbox_probe(struct platform_device *pdev)
 	if (!chans)
 		return -ENOMEM;
 
-	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	mbox->base = devm_ioremap_resource(&pdev->dev, regs);
+	mbox->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mbox->base)) {
 		dev_err(&pdev->dev, "ioremap failed\n");
 		return PTR_ERR(mbox->base);
Signature · 1 line
2.17.1
#17 lore raw

Re: [PATCH 13/13] mailbox: armada-37xx-rwtm: convert to devm_platform_ioremap_resource

Hi Yangtao Li,

Quoted 3 lines

Use devm_platform_ioremap_resource() to simplify code.

Applied on mvebu/drivers

Thanks,

Gregory

Quoted 35 lines
---
 drivers/mailbox/armada-37xx-rwtm-mailbox.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mailbox/armada-37xx-rwtm-mailbox.c +1 -4
index 19f086716dc5..02b7b28e6969 100644
@@ -143,7 +143,6 @@ static const struct mbox_chan_ops a37xx_mbox_ops = {
 static int armada_37xx_mbox_probe(struct platform_device *pdev)
 {
 	struct a37xx_mbox *mbox;
-	struct resource *regs;
 	struct mbox_chan *chans;
 	int ret;
 
@@ -156,9 +155,7 @@ static int armada_37xx_mbox_probe(struct platform_device *pdev)
 	if (!chans)
 		return -ENOMEM;
 
-	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	mbox->base = devm_ioremap_resource(&pdev->dev, regs);
+	mbox->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mbox->base)) {
 		dev_err(&pdev->dev, "ioremap failed\n");
 		return PTR_ERR(mbox->base);
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
Reviewed-by on v1 1/13
#18 lore raw
In reply to Yangtao Li
Quoted 19 lines

-----Original Message-----
From: Yangtao Li <[email protected]>
Sent: Sunday, December 29, 2019 2:35 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; bcm- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]
Cc: Yangtao Li <[email protected]>
Subject: [PATCH 01/13] mailbox: altera: convert to devm_platform_ioremap_resource

Quoted 3 lines

Use devm_platform_ioremap_resource() to simplify code.

Quoted 41 lines
---
 drivers/mailbox/mailbox-altera.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mailbox/mailbox- renamed from drivers/mailbox/mailbox-altera.c +0 -0

altera.c
index 75282666fb06..afb320e9d69c 100644

drivers/mailbox/mailbox-altera.c +1 -5
@@ -285,7 +285,6 @@ static const struct mbox_chan_ops altera_mbox_ops
 = {  static int altera_mbox_probe(struct platform_device *pdev)  {
        struct altera_mbox *mbox;
-       struct resource *regs;
        struct mbox_chan *chans;
        int ret;
 
@@ -299,9 +298,7 @@ static int altera_mbox_probe(struct platform_device
 *pdev)
        if (!chans)
                return -ENOMEM;
 
-       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-       mbox->mbox_base = devm_ioremap_resource(&pdev->dev, regs);
+       mbox->mbox_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mbox->mbox_base))
                return PTR_ERR(mbox->mbox_base);
 
--

2.17.1

________________________________

Confidentiality Notice.
This message may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any use, disclosure, dissemination, distribution, or copying of this message, or any attachments, is strictly prohibited. If you have received this message in error, please advise the sender by reply e-mail, and delete the message and any attachments. Thank you.