2020-09-08 22:47:02

by Dmitry Osipenko

[permalink] [raw]
Subject: [PATCH v7 11/34] i2c: tegra: Use platform_get_irq()

Use common helper for retrieval of the interrupt number in order to make
code cleaner. Note that platform_get_irq() prints error message by itself.

Reviewed-by: Michał Mirosław <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
---
drivers/i2c/busses/i2c-tegra.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index c2bbdf92b11f..505b5d37077d 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -1684,12 +1684,9 @@ static int tegra_i2c_probe(struct platform_device *pdev)

base_phys = res->start;

- res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (!res) {
- dev_err(&pdev->dev, "no irq resource\n");
- return -EINVAL;
- }
- irq = res->start;
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;

div_clk = devm_clk_get(&pdev->dev, "div-clk");
if (IS_ERR(div_clk)) {
--
2.27.0


2020-09-17 11:42:10

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v7 11/34] i2c: tegra: Use platform_get_irq()

On Wed, Sep 09, 2020 at 01:39:43AM +0300, Dmitry Osipenko wrote:
> Use common helper for retrieval of the interrupt number in order to make
> code cleaner. Note that platform_get_irq() prints error message by itself.
>
> Reviewed-by: Michał Mirosław <[email protected]>
> Signed-off-by: Dmitry Osipenko <[email protected]>
> ---
> drivers/i2c/busses/i2c-tegra.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (494.00 B)
signature.asc (849.00 B)
Download all attachments

2020-09-21 10:20:54

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v7 11/34] i2c: tegra: Use platform_get_irq()

On Wed, 09 Sep 2020 01:39:43 +0300, Dmitry Osipenko wrote:
> Use common helper for retrieval of the interrupt number in order to make
> code cleaner. Note that platform_get_irq() prints error message by itself.
>
> Reviewed-by: Michał Mirosław <[email protected]>
> Signed-off-by: Dmitry Osipenko <[email protected]>
> Acked-by: Thierry Reding <[email protected]>
> ---
> drivers/i2c/busses/i2c-tegra.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)

Tested-by: Thierry Reding <[email protected]>