* [PATCH 3/3] i2c: qup: Use devm_platform_ioremap_resource helper
@ 2019-09-16 19:02 Saiyam Doshi
2019-09-17 15:40 ` [3/3] " Markus Elfring
0 siblings, 1 reply; 3+ messages in thread
From: Saiyam Doshi @ 2019-09-16 19:02 UTC (permalink / raw)
To: agross; +Cc: linux-arm-msm, linux-i2c, linux-kernel
Use devm_platform_ioremap_resource helper which wraps
platform_get_resource() and devm_ioremap_resource() together.
The semantic patch that makes this report is available
in scripts/coccinelle/api/devm_platform_ioremap_resource.cocci.
Found using - http://coccinelle.lip6.fr/
Signed-off-by: Saiyam Doshi <saiyamdoshi.in@gmail.com>
---
drivers/i2c/busses/i2c-qup.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 23c4893512b2..2d21168f81a0 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1663,7 +1663,6 @@ static int qup_i2c_probe(struct platform_device *pdev)
static const int blk_sizes[] = {4, 16, 32};
struct qup_i2c_dev *qup;
unsigned long one_bit_t;
- struct resource *res;
u32 io_mode, hw_ver, size;
int ret, fs_div, hs_div;
u32 src_clk_freq = DEFAULT_SRC_CLK;
@@ -1760,8 +1759,7 @@ static int qup_i2c_probe(struct platform_device *pdev)
return -EINVAL;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- qup->base = devm_ioremap_resource(qup->dev, res);
+ qup->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(qup->base))
return PTR_ERR(qup->base);
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [3/3] i2c: qup: Use devm_platform_ioremap_resource helper
2019-09-16 19:02 [PATCH 3/3] i2c: qup: Use devm_platform_ioremap_resource helper Saiyam Doshi
@ 2019-09-17 15:40 ` Markus Elfring
2019-09-17 16:38 ` Saiyam Doshi
0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2019-09-17 15:40 UTC (permalink / raw)
To: Saiyam Doshi, Andy Gross, linux-arm-msm, linux-i2c
Cc: linux-kernel, kernel-janitors
> Use devm_platform_ioremap_resource helper which wraps
> platform_get_resource() and devm_ioremap_resource() together.
Can a wording like “Simplify this function implementation by using
a known wrapper function.” be nicer for this change description?
> The semantic patch that makes this report is available
> in scripts/coccinelle/api/devm_platform_ioremap_resource.cocci.
>
> Found using - http://coccinelle.lip6.fr/
Can a tag like “Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci”
be more helpful than the other description variant?
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [3/3] i2c: qup: Use devm_platform_ioremap_resource helper
2019-09-17 15:40 ` [3/3] " Markus Elfring
@ 2019-09-17 16:38 ` Saiyam Doshi
0 siblings, 0 replies; 3+ messages in thread
From: Saiyam Doshi @ 2019-09-17 16:38 UTC (permalink / raw)
To: Markus Elfring
Cc: Andy Gross, linux-arm-msm, linux-i2c, linux-kernel, kernel-janitors
On Tue, Sep 17, 2019 at 05:40:14PM +0200, Markus Elfring wrote:
> > Use devm_platform_ioremap_resource helper which wraps
> > platform_get_resource() and devm_ioremap_resource() together.
>
> Can a wording like “Simplify this function implementation by using
> a known wrapper function.” be nicer for this change description?
Okay. I will change as actual change and changelog is almost similar :)
> > The semantic patch that makes this report is available
> > in scripts/coccinelle/api/devm_platform_ioremap_resource.cocci.
> >
> > Found using - http://coccinelle.lip6.fr/
>
> Can a tag like “Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci”
> be more helpful than the other description variant?
will update this in changelog and resend this series.
-Saiyam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-17 16:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16 19:02 [PATCH 3/3] i2c: qup: Use devm_platform_ioremap_resource helper Saiyam Doshi
2019-09-17 15:40 ` [3/3] " Markus Elfring
2019-09-17 16:38 ` Saiyam Doshi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).