From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
Wolfram Sang <wsa@kernel.org>,
linux-rtc@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH 2/9] rtc: ds1307: Convert to .probe_new()
Date: Wed, 2 Nov 2022 17:24:29 +0100 [thread overview]
Message-ID: <Y2KZvY4MNdmCjo3L@mail.local> (raw)
In-Reply-To: <20221021130706.178687-3-u.kleine-koenig@pengutronix.de>
On 21/10/2022 15:06:59+0200, Uwe Kleine-König wrote:
> .probe_new() doesn't get the i2c_device_id * parameter, so determine
> that explicitly in .probe().
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/rtc/rtc-ds1307.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
> index d51565bcc189..70a6755a7d69 100644
> --- a/drivers/rtc/rtc-ds1307.c
> +++ b/drivers/rtc/rtc-ds1307.c
> @@ -1712,9 +1712,9 @@ static const struct regmap_config regmap_config = {
> .val_bits = 8,
> };
>
> -static int ds1307_probe(struct i2c_client *client,
> - const struct i2c_device_id *id)
> +static int ds1307_probe(struct i2c_client *client)
> {
> + const struct i2c_device_id *id;
> struct ds1307 *ds1307;
> const void *match;
> int err = -ENODEV;
> @@ -1746,7 +1746,7 @@ static int ds1307_probe(struct i2c_client *client,
> if (match) {
> ds1307->type = (enum ds_type)match;
> chip = &chips[ds1307->type];
> - } else if (id) {
> + } else if ((id = i2c_match_id(ds1307_id, client))) {
This is not proper style for the kernel and it introduces a checkpatch
error.
> chip = &chips[id->driver_data];
> ds1307->type = id->driver_data;
> } else {
> @@ -2011,7 +2011,7 @@ static struct i2c_driver ds1307_driver = {
> .name = "rtc-ds1307",
> .of_match_table = ds1307_of_match,
> },
> - .probe = ds1307_probe,
> + .probe_new = ds1307_probe,
> .id_table = ds1307_id,
> };
>
> --
> 2.37.2
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2022-11-02 16:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 13:06 [PATCH 0/9] rtc: Convert i2c drivers to .probe_new() Uwe Kleine-König
2022-10-21 13:06 ` Uwe Kleine-König
2022-10-21 13:06 ` [PATCH 1/9] rtc: abx80x: Convert " Uwe Kleine-König
2022-10-21 13:06 ` [PATCH 2/9] rtc: ds1307: " Uwe Kleine-König
2022-11-02 16:24 ` Alexandre Belloni [this message]
2022-10-21 13:07 ` [PATCH 3/9] rtc: isl1208: " Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 4/9] rtc: m41t80: " Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 5/9] rtc: nct3018y: " Uwe Kleine-König
2022-10-21 13:07 ` Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 6/9] rtc: pcf2127: " Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 7/9] rtc: rs5c372: " Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 8/9] rtc: rv8803: " Uwe Kleine-König
2022-10-21 13:07 ` [PATCH 9/9] rtc: rx8025: " Uwe Kleine-König
2022-11-02 16:23 ` [PATCH 0/9] rtc: Convert i2c drivers " Alexandre Belloni
2022-11-02 16:23 ` Alexandre Belloni
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=Y2KZvY4MNdmCjo3L@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=kernel@pengutronix.de \
--cc=linux-rtc@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wsa@kernel.org \
/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.