From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Prabhakar <prabhakar.csengg@gmail.com>
Cc: Chris Brandt <chris.brandt@renesas.com>,
Andi Shyti <andi.shyti@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org,
Biju Das <biju.das.jz@bp.renesas.com>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v3 1/8] i2c: riic: Use dev_err_probe in probe and riic_init_hw functions
Date: Sun, 29 Dec 2024 01:32:46 +0200 [thread overview]
Message-ID: <Z3CKnu60lVuDBedn@surfacebook.localdomain> (raw)
In-Reply-To: <20241227115154.56154-2-prabhakar.mahadev-lad.rj@bp.renesas.com>
Fri, Dec 27, 2024 at 11:51:47AM +0000, Prabhakar kirjoitti:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Refactor error handling in the riic_i2c_probe() and riic_init_hw()
> functions by replacing multiple dev_err() calls with dev_err_probe().
>
> Additionally, update the riic_init_hw() function to use a local `dev`
> pointer instead of `riic->adapter.dev` for dev_err_probe(), as the I2C
> adapter is not initialized at this stage.
...
> + if (brl > (0x1F + 3))
> + return dev_err_probe(dev, -EINVAL, "invalid speed (%lu). Too slow.\n",
> + (unsigned long)t->bus_freq_hz);
There is nothing special about bus_freq_hz. Why casting?
...
> ret = devm_request_irq(dev, ret, riic_irqs[i].isr,
I hate code doing
ret = foo(ret);
> 0, riic_irqs[i].name, riic);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to request irq %s\n",
> + riic_irqs[i].name);
While this following the original code, with the above change (introducing a
separate variable for IRQ) this might also print it.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-12-28 23:33 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-27 11:51 [PATCH v3 0/8] i2c: riic: driver cleanup and improvements Prabhakar
2024-12-27 11:51 ` [PATCH v3 1/8] i2c: riic: Use dev_err_probe in probe and riic_init_hw functions Prabhakar
2024-12-28 23:32 ` Andy Shevchenko [this message]
2024-12-31 14:20 ` Lad, Prabhakar
2024-12-27 11:51 ` [PATCH v3 2/8] i2c: riic: Use local `dev` pointer in `dev_err_probe()` Prabhakar
2024-12-27 11:51 ` [PATCH v3 3/8] i2c: riic: Use BIT macro consistently Prabhakar
2024-12-28 23:34 ` Andy Shevchenko
2025-01-02 9:07 ` Lad, Prabhakar
2024-12-27 11:51 ` [PATCH v3 4/8] i2c: riic: Use GENMASK() macro for bitmask definitions Prabhakar
2024-12-28 23:36 ` Andy Shevchenko
2025-01-02 9:09 ` Lad, Prabhakar
2025-01-01 12:11 ` David Laight
2025-01-02 8:53 ` Lad, Prabhakar
2024-12-27 11:51 ` [PATCH v3 5/8] i2c: riic: Make use of devres helper to request deasserted reset line Prabhakar
2024-12-27 11:51 ` [PATCH v3 6/8] i2c: riic: Mark riic_irqs array as const Prabhakar
2024-12-27 11:51 ` [PATCH v3 7/8] i2c: riic: Use predefined macro and simplify clock tick calculation Prabhakar
2024-12-28 23:37 ` Andy Shevchenko
2025-01-02 10:05 ` Lad, Prabhakar
2024-12-27 11:51 ` [PATCH v3 8/8] i2c: riic: Add `riic_bus_barrier()` to check bus availability Prabhakar
2024-12-28 23:40 ` Andy Shevchenko
2025-01-02 10:32 ` Lad, Prabhakar
2024-12-27 22:10 ` [PATCH v3 0/8] i2c: riic: driver cleanup and improvements Andi Shyti
2024-12-28 23:40 ` Andy Shevchenko
2024-12-29 23:42 ` Andi Shyti
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=Z3CKnu60lVuDBedn@surfacebook.localdomain \
--to=andy.shevchenko@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=biju.das.jz@bp.renesas.com \
--cc=chris.brandt@renesas.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert+renesas@glider.be \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=prabhakar.csengg@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=wsa+renesas@sang-engineering.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: link
Be 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.