[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250103091900.428729-2-prabhakar.mahadev-lad.rj@bp.renesas.com>
Date: Fri, 3 Jan 2025 09:18:52 +0000
From: Prabhakar <prabhakar.csengg@...il.com>
To: Chris Brandt <chris.brandt@...esas.com>,
Andi Shyti <andi.shyti@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Philipp Zabel <p.zabel@...gutronix.de>
Cc: linux-renesas-soc@...r.kernel.org,
linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org,
Prabhakar <prabhakar.csengg@...il.com>,
Biju Das <biju.das.jz@...renesas.com>,
Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: [PATCH v4 1/9] i2c: riic: Introduce a separate variable for IRQ
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Refactor the IRQ handling in riic_i2c_probe by introducing a local variable
`irq` to store IRQ numbers instead of assigning them to `ret`. This change
improves code readability and clarity.
Remove explicit error handling after `platform_get_irq()` since
`devm_request_irq()` already handles such errors.
Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
---
v3->v4
- New patch
---
drivers/i2c/busses/i2c-riic.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c
index 9264adc97ca9..c9b2ceaf4000 100644
--- a/drivers/i2c/busses/i2c-riic.c
+++ b/drivers/i2c/busses/i2c-riic.c
@@ -464,11 +464,9 @@ static int riic_i2c_probe(struct platform_device *pdev)
return ret;
for (i = 0; i < ARRAY_SIZE(riic_irqs); i++) {
- ret = platform_get_irq(pdev, riic_irqs[i].res_num);
- if (ret < 0)
- return ret;
+ int irq = platform_get_irq(pdev, riic_irqs[i].res_num);
- ret = devm_request_irq(dev, ret, riic_irqs[i].isr,
+ ret = devm_request_irq(dev, irq, riic_irqs[i].isr,
0, riic_irqs[i].name, riic);
if (ret) {
dev_err(dev, "failed to request irq %s\n", riic_irqs[i].name);
--
2.43.0
Powered by blists - more mailing lists