From: Wolfram Sang <wsa@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>, Marek Vasut <marex@denx.de>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>
Subject: Re: [PATCH v3] i2c: Add i2c_get_match_data()
Date: Wed, 7 Jun 2023 12:20:17 +0200 [thread overview]
Message-ID: <ZIBZ4RzFvLN368nQ@shikoro> (raw)
In-Reply-To: <CAMuHMdVXekgea3biJXXNb3fa-8Fe3iUJ=K51jKnu9ew_+Fq69g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 540 bytes --]
> > +const void *i2c_get_match_data(const struct i2c_client *client) {
> > + struct device_driver *drv = client->dev.driver;
> > + struct i2c_driver *driver = to_i2c_driver(drv);
> > + const struct i2c_device_id *match;
> > + const void *data;
> > +
> > + data = device_get_match_data(&client->dev);
>
> if (data)
> return data;
I like Biju's version a tad more. Except for errors, and especially
within small functions, I think single exit points are easier to
understand.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-06-07 10:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230606130519.382304-1-biju.das.jz@bp.renesas.com>
2023-06-07 7:21 ` [PATCH v3] i2c: Add i2c_get_match_data() Biju Das
2023-06-07 9:28 ` Geert Uytterhoeven
2023-06-07 9:36 ` Biju Das
2023-06-07 10:20 ` Wolfram Sang [this message]
2023-06-07 16:47 ` Biju Das
2023-06-07 10:17 ` 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=ZIBZ4RzFvLN368nQ@shikoro \
--to=wsa@kernel.org \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=geert@linux-m68k.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=marex@denx.de \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox