From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Pavan Holla <pholla@chromium.org>,
abhishekpandit@chromium.org, bleung@chromium.org,
chrome-platform@lists.linux.dev, gregkh@linuxfoundation.org,
groeck@chromium.org, heikki.krogerus@linux.intel.com,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 3/3] platform/chrome: cros_ec_ucsi: Implement UCSI PDC driver
Date: Fri, 29 Mar 2024 09:37:30 +0800 [thread overview]
Message-ID: <ZgYbWjnFbrPWYY2j@google.com> (raw)
In-Reply-To: <d71c51ab-e59e-409e-bafd-22c1528c6774@kernel.org>
On Thu, Mar 28, 2024 at 01:16:36PM +0100, Krzysztof Kozlowski wrote:
> On 28/03/2024 10:57, Tzung-Bi Shih wrote:
> > By looking other use cases of mfd_add_hotplug_devices():
> > $ grep -R --files-with-matches mfd_add_hotplug_devices drivers/mfd/
> > drivers/mfd/dln2.c
> > drivers/mfd/cros_ec_dev.c
> > drivers/mfd/viperboard.c
> >
> > They also have no ID tables and need MODULE_ALIAS().
> > - drivers/gpio/gpio-dln2.c
> > - drivers/i2c/busses/i2c-dln2.c
> > - drivers/spi/spi-dln2.c
> > - drivers/iio/adc/dln2-adc.c
> > - drivers/gpio/gpio-viperboard.c
> > - drivers/i2c/busses/i2c-viperboard.c
> > - drivers/iio/adc/viperboard_adc.c
>
> So if there is a bug in some driver, you are allowed to add it? :) There
> is plenty of poor examples, so what I was suggesting to look for good
> examples. I agree that itself might be a tricky task.
>
> > I'm not sure whether using the path results in:
> > - Lack of device ID table.
> > - Need MODULE_ALIAS().
> > in the platform device drivers. And perhaps it relies on the fallback match?
>
> Guys, think for a sec. If you are adding module alias being equivalent
> to platform ID table entry, then why you are not using the platform ID
> table entry in the first? That's the entire point.
>
> So to repeat myself:
> If you need it, usually it means your device ID table is wrong (e.g.
> misses either entries or MODULE_DEVICE_TABLE()).
>
> MODULE_ALIAS() is not a substitute for incomplete ID table.
Thanks. I see.
Yet another example in: drivers/mfd/max8997.c and drivers/rtc/rtc-max8997.c.
We should be able to use a platform_device_id, MODULE_DEVICE_TABLE(), and
`.id_table` for matching.
If that works, I think we need to turn most MODULE_ALIAS() use cases in
drivers/platform/chrome/ to this way afterward.
next prev parent reply other threads:[~2024-03-29 1:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 23:42 [PATCH v2 0/3] usb: typec: Implement UCSI driver for ChromeOS Pavan Holla
2024-03-25 23:42 ` [PATCH v2 1/3] usb: typec: ucsi: Provide interface for UCSI transport Pavan Holla
2024-03-25 23:42 ` [PATCH v2 2/3] usb: typec: ucsi: Import " Pavan Holla
2024-03-27 11:22 ` Heikki Krogerus
2024-03-27 22:40 ` Pavan Holla
2024-03-25 23:42 ` [PATCH v2 3/3] platform/chrome: cros_ec_ucsi: Implement UCSI PDC driver Pavan Holla
2024-03-26 8:46 ` Krzysztof Kozlowski
2024-03-27 3:39 ` Pavan Holla
2024-03-27 4:59 ` Krzysztof Kozlowski
2024-03-28 2:32 ` Pavan Holla
2024-03-28 8:36 ` Krzysztof Kozlowski
2024-03-28 9:57 ` Tzung-Bi Shih
2024-03-28 12:16 ` Krzysztof Kozlowski
2024-03-29 1:37 ` Tzung-Bi Shih [this message]
2024-03-28 15:32 ` Dmitry Baryshkov
2024-03-29 15:08 ` Pavan Holla
2024-03-29 15:13 ` Dmitry Baryshkov
2024-04-01 20:32 ` Pavan Holla
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=ZgYbWjnFbrPWYY2j@google.com \
--to=tzungbi@kernel.org \
--cc=abhishekpandit@chromium.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=groeck@chromium.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pholla@chromium.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 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).