From: Tzung-Bi Shih <tzungbi@google.com>
To: Prashant Malani <pmalani@chromium.org>
Cc: bleung@chromium.org, groeck@chromium.org, robh+dt@kernel.org,
chrome-platform@lists.linux.dev, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] platform/chrome: cros_kbd_led_backlight: support OF match
Date: Wed, 16 Feb 2022 10:31:32 +0800 [thread overview]
Message-ID: <YgxiBO7jDtyhWwlb@google.com> (raw)
In-Reply-To: <CACeCKac+b1Rp6bZFALn=sbh8gkJbWeKTC=8bdzp+-90pgq=wSw@mail.gmail.com>
On Tue, Feb 15, 2022 at 05:10:04PM -0800, Prashant Malani wrote:
> On Sun, Feb 13, 2022 at 9:37 PM Tzung-Bi Shih <tzungbi@google.com> wrote:
> > diff --git a/drivers/platform/chrome/cros_kbd_led_backlight.c b/drivers/platform/chrome/cros_kbd_led_backlight.c
> > index 814f2b74c602..ba853e55d29a 100644
> > --- a/drivers/platform/chrome/cros_kbd_led_backlight.c
> > +++ b/drivers/platform/chrome/cros_kbd_led_backlight.c
> > @@ -10,6 +10,7 @@
> > #include <linux/kernel.h>
> > #include <linux/leds.h>
> > #include <linux/module.h>
> > +#include <linux/of_device.h>
> > #include <linux/platform_device.h>
> > #include <linux/slab.h>
> >
> > @@ -128,8 +129,11 @@ static int keyboard_led_probe(struct platform_device *pdev)
> > int error;
> >
> > drvdata = acpi_device_get_match_data(&pdev->dev);
> > - if (!drvdata)
> > - return -EINVAL;
> > + if (!drvdata) {
> > + drvdata = of_device_get_match_data(&pdev->dev);
> > + if (!drvdata)
> > + return -EINVAL;
> > + }
>
> I'm not familiar with this driver, so can't do a full review, but
> shouldn't device_get_match_data()
> from property.h [1] be able to handle both DT and ACPI cases?
>
> [1]: https://elixir.bootlin.com/linux/v5.17-rc4/source/include/linux/property.h
Yes, it does[2][3]. Thanks for the feedback, will fix it in next version.
[2]: https://elixir.bootlin.com/linux/v5.17-rc4/source/drivers/of/property.c#L1474
[3]: https://elixir.bootlin.com/linux/v5.17-rc4/source/drivers/acpi/property.c#L1386
next prev parent reply other threads:[~2022-02-16 2:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-14 5:36 [PATCH 0/5] platform/chrome: cros_kbd_led_backlight: add EC PWM backend Tzung-Bi Shih
2022-02-14 5:36 ` [PATCH 1/5] platform/chrome: cros_kbd_led_backlight: sort headers alphabetically Tzung-Bi Shih
2022-02-14 5:36 ` [PATCH 2/5] platform/chrome: cros_kbd_led_backlight: separate ACPI backend Tzung-Bi Shih
2022-02-14 19:53 ` kernel test robot
2022-02-14 19:53 ` kernel test robot
2022-02-15 1:40 ` Tzung-Bi Shih
2022-02-14 5:36 ` [PATCH 3/5] dt-bindings: add google,cros-kbd-led-backlight Tzung-Bi Shih
2022-03-02 21:54 ` Rob Herring
2022-02-14 5:36 ` [PATCH 4/5] platform/chrome: cros_kbd_led_backlight: support OF match Tzung-Bi Shih
2022-02-14 17:19 ` kernel test robot
2022-02-15 1:40 ` Tzung-Bi Shih
2022-02-16 1:10 ` Prashant Malani
2022-02-16 2:31 ` Tzung-Bi Shih [this message]
2022-02-14 5:36 ` [PATCH 5/5] platform/chrome: cros_kbd_led_backlight: support EC PWM backend Tzung-Bi Shih
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=YgxiBO7jDtyhWwlb@google.com \
--to=tzungbi@google.com \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=devicetree@vger.kernel.org \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmalani@chromium.org \
--cc=robh+dt@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.