From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v2 1/5] usb: typec: tcpci_rt1711h: Make similar OF and ID table
Date: Mon, 4 Sep 2023 11:34:36 +0300 [thread overview]
Message-ID: <ZPWWnOyhoOkLzOlV@kuha.fi.intel.com> (raw)
In-Reply-To: <20230831160501.55081-2-biju.das.jz@bp.renesas.com>
On Thu, Aug 31, 2023 at 05:04:57PM +0100, Biju Das wrote:
> Make similar OF and ID table to extend support for ID match
> using i2c_match_data() later. Currently it works only for OF match
> tables as the driver_data is wrong for ID match.
>
> While at it, drop a space from the terminator braces for ID table and
> remove trailing comma in the terminator entry for OF table.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
> * Drop space from ID table
> * Remove trailing comma in the terminator entry for OF table.
> ---
> drivers/usb/typec/tcpm/tcpci_rt1711h.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
> index 17ebc5fb684f..5ed3d0864431 100644
> --- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c
> +++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c
> @@ -392,9 +392,9 @@ static void rt1711h_remove(struct i2c_client *client)
> }
>
> static const struct i2c_device_id rt1711h_id[] = {
> - { "rt1711h", 0 },
> - { "rt1715", 0 },
> - { }
> + { "rt1711h", RT1711H_DID },
> + { "rt1715", RT1715_DID },
> + {}
This is too confusing and messy. Don't assign those RT1711H_DID in
this patch at all - you are not using the I2C driver data anywhere
yet, and in next patch where you start using it, you replace those
assignments with an actual driver data structure that then contain the
values (that did memeber). So there is not point in using the driver
data here at all.
Just make this patch a cleanup patch where you remove the commas, and
deal with those RT1715_DID in the next patch just like you already do.
> };
> MODULE_DEVICE_TABLE(i2c, rt1711h_id);
>
> @@ -402,7 +402,7 @@ MODULE_DEVICE_TABLE(i2c, rt1711h_id);
> static const struct of_device_id rt1711h_of_match[] = {
> { .compatible = "richtek,rt1711h", .data = (void *)RT1711H_DID },
> { .compatible = "richtek,rt1715", .data = (void *)RT1715_DID },
> - {},
> + {}
> };
> MODULE_DEVICE_TABLE(of, rt1711h_of_match);
> #endif
thanks,
--
heikki
next prev parent reply other threads:[~2023-09-04 8:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 16:04 [PATCH v2 0/5] Match data improvements for rt1711h driver Biju Das
2023-08-31 16:04 ` [PATCH v2 1/5] usb: typec: tcpci_rt1711h: Make similar OF and ID table Biju Das
2023-08-31 16:18 ` Andy Shevchenko
2023-08-31 16:22 ` Biju Das
2023-09-04 8:34 ` Heikki Krogerus [this message]
2023-08-31 16:04 ` [PATCH v2 2/5] usb: typec: tcpci_rt1711h: Convert enum->pointer for data in the match tables Biju Das
2023-08-31 16:04 ` [PATCH v2 3/5] usb: typec: tcpci_rt1711h: Add rxdz_sel variable to struct rt1711h_chip_info Biju Das
2023-08-31 16:05 ` [PATCH v2 4/5] usb: typec: tcpci_rt1711h: Add enable_pd30_extended_message " Biju Das
2023-08-31 16:05 ` [PATCH v2 5/5] usb: typec: tcpci_rt1711h: Drop CONFIG_OF ifdeffery Biju Das
2023-08-31 16:20 ` Andy Shevchenko
2023-08-31 16:21 ` [PATCH v2 0/5] Match data improvements for rt1711h driver Andy Shevchenko
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=ZPWWnOyhoOkLzOlV@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
/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;
as well as URLs for NNTP newsgroup(s).