From: Yangtao Li <frank.li@vivo.com> To: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>, Andi Shyti <andi.shyti@kernel.org>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@microchip.com> Cc: Yangtao Li <frank.li@vivo.com>, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Date: Mon, 10 Jul 2023 14:33:40 +0800 [thread overview] Message-ID: <20230710063351.17490-1-frank.li@vivo.com> (raw) Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> --- drivers/i2c/busses/i2c-at91-core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c index 05ad3bc3578a..de3b8f1053e7 100644 --- a/drivers/i2c/busses/i2c-at91-core.c +++ b/drivers/i2c/busses/i2c-at91-core.c @@ -207,19 +207,15 @@ static int at91_twi_probe(struct platform_device *pdev) dev->dev = &pdev->dev; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem) - return -ENODEV; + dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); + if (IS_ERR(dev->base)) + return PTR_ERR(dev->base); phy_addr = mem->start; dev->pdata = at91_twi_get_driver_data(pdev); if (!dev->pdata) return -ENODEV; - dev->base = devm_ioremap_resource(&pdev->dev, mem); - if (IS_ERR(dev->base)) - return PTR_ERR(dev->base); - dev->irq = platform_get_irq(pdev, 0); if (dev->irq < 0) return dev->irq; -- 2.39.0
WARNING: multiple messages have this Message-ID (diff)
From: Yangtao Li <frank.li@vivo.com> To: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>, Andi Shyti <andi.shyti@kernel.org>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@microchip.com> Cc: Yangtao Li <frank.li@vivo.com>, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Date: Mon, 10 Jul 2023 14:33:40 +0800 [thread overview] Message-ID: <20230710063351.17490-1-frank.li@vivo.com> (raw) Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> --- drivers/i2c/busses/i2c-at91-core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c index 05ad3bc3578a..de3b8f1053e7 100644 --- a/drivers/i2c/busses/i2c-at91-core.c +++ b/drivers/i2c/busses/i2c-at91-core.c @@ -207,19 +207,15 @@ static int at91_twi_probe(struct platform_device *pdev) dev->dev = &pdev->dev; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem) - return -ENODEV; + dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); + if (IS_ERR(dev->base)) + return PTR_ERR(dev->base); phy_addr = mem->start; dev->pdata = at91_twi_get_driver_data(pdev); if (!dev->pdata) return -ENODEV; - dev->base = devm_ioremap_resource(&pdev->dev, mem); - if (IS_ERR(dev->base)) - return PTR_ERR(dev->base); - dev->irq = platform_get_irq(pdev, 0); if (dev->irq < 0) return dev->irq; -- 2.39.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2023-07-10 6:34 UTC|newest] Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-07-10 6:33 Yangtao Li [this message] 2023-07-10 6:33 ` [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li 2023-07-10 6:33 ` [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource() Yangtao Li 2023-07-10 6:33 ` Yangtao Li 2023-07-12 15:40 ` Andi Shyti 2023-07-12 15:40 ` Andi Shyti 2023-07-10 6:33 ` [PATCH v2 03/11] i2c: brcmstb: " Yangtao Li 2023-07-10 6:33 ` Yangtao Li 2023-07-10 18:21 ` Kamal Dasu 2023-07-10 18:21 ` Kamal Dasu 2023-07-10 21:00 ` Florian Fainelli 2023-07-10 21:00 ` Florian Fainelli 2023-07-12 15:43 ` Andi Shyti 2023-07-12 15:43 ` Andi Shyti 2023-07-10 6:33 ` [PATCH v2 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource() Yangtao Li 2023-07-12 15:49 ` Andi Shyti 2023-07-10 6:33 ` [PATCH v2 05/11] i2c: stm32f4: " Yangtao Li 2023-07-10 6:33 ` Yangtao Li 2023-07-12 15:49 ` Andi Shyti 2023-07-12 15:49 ` Andi Shyti 2023-07-10 6:33 ` [PATCH v2 06/11] i2c: qcom-geni: Convert to devm_platform_ioremap_resource() Yangtao Li 2023-07-12 15:52 ` Andi Shyti 2023-07-10 6:33 ` [PATCH v2 07/11] i2c: st: Use devm_platform_get_and_ioremap_resource() Yangtao Li 2023-07-10 6:33 ` Yangtao Li 2023-07-12 15:52 ` Andi Shyti 2023-07-12 15:52 ` Andi Shyti 2023-07-10 6:33 ` [PATCH v2 08/11] i2c: sh_mobile: " Yangtao Li 2023-07-10 12:13 ` Geert Uytterhoeven 2023-07-12 15:57 ` Andi Shyti 2023-07-10 6:33 ` [PATCH v2 09/11] i2c: s3c2410: " Yangtao Li 2023-07-10 6:33 ` Yangtao Li 2023-07-12 15:58 ` Andi Shyti 2023-07-12 15:58 ` Andi Shyti 2023-07-10 6:33 ` [PATCH v2 10/11] i2c: pxa: " Yangtao Li 2023-07-12 15:59 ` Andi Shyti 2023-07-10 6:33 ` [PATCH v2 11/11] i2c: pnx: " Yangtao Li 2023-07-10 6:33 ` Yangtao Li 2023-07-12 16:00 ` Andi Shyti 2023-07-12 16:00 ` Andi Shyti 2023-07-12 15:37 ` [PATCH v2 01/11] i2c: at91: " Andi Shyti 2023-07-12 15:37 ` Andi Shyti 2023-08-14 16:10 ` Wolfram Sang 2023-08-14 16:10 ` Wolfram Sang
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230710063351.17490-1-frank.li@vivo.com \ --to=frank.li@vivo.com \ --cc=alexandre.belloni@bootlin.com \ --cc=andi.shyti@kernel.org \ --cc=claudiu.beznea@microchip.com \ --cc=codrin.ciubotariu@microchip.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-i2c@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=nicolas.ferre@microchip.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.