public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data()
@ 2023-11-15 21:02 Rob Herring
  2023-11-30 18:55 ` Miguel Ojeda
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2023-11-15 21:02 UTC (permalink / raw)
  To: Paul Burton, Miguel Ojeda; +Cc: linux-kernel

Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/auxdisplay/img-ascii-lcd.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c
index fa23e415f260..c16a14becdfc 100644
--- a/drivers/auxdisplay/img-ascii-lcd.c
+++ b/drivers/auxdisplay/img-ascii-lcd.c
@@ -8,9 +8,9 @@
 #include <linux/io.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
 
@@ -225,17 +225,12 @@ MODULE_DEVICE_TABLE(of, img_ascii_lcd_matches);
  */
 static int img_ascii_lcd_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *match;
 	const struct img_ascii_lcd_config *cfg;
 	struct device *dev = &pdev->dev;
 	struct img_ascii_lcd_ctx *ctx;
 	int err;
 
-	match = of_match_device(img_ascii_lcd_matches, dev);
-	if (!match)
-		return -ENODEV;
-
-	cfg = match->data;
+	cfg = device_get_match_data(&pdev->dev);
 	ctx = devm_kzalloc(dev, sizeof(*ctx) + cfg->num_chars, GFP_KERNEL);
 	if (!ctx)
 		return -ENOMEM;
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data()
  2023-11-15 21:02 [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data() Rob Herring
@ 2023-11-30 18:55 ` Miguel Ojeda
  2023-11-30 19:11   ` Geert Uytterhoeven
  2023-12-01 13:39   ` Rob Herring
  0 siblings, 2 replies; 7+ messages in thread
From: Miguel Ojeda @ 2023-11-30 18:55 UTC (permalink / raw)
  To: Rob Herring; +Cc: Paul Burton, Miguel Ojeda, linux-kernel, Geert Uytterhoeven

On Wed, Nov 15, 2023 at 10:02 PM Rob Herring <robh@kernel.org> wrote:
>
> +       cfg = device_get_match_data(&pdev->dev);

This sounds good to me, but a couple notes:

  - This could be `dev` since we have it, no?

  - Orthogonally, should we just directly initialize `cfg` since now we can?

Cc'ing Geert as well since he was the last one touching the file (in
fact, he added the `dev` variable).

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data()
  2023-11-30 18:55 ` Miguel Ojeda
@ 2023-11-30 19:11   ` Geert Uytterhoeven
  2023-12-01 13:39   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2023-11-30 19:11 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Rob Herring, Paul Burton, Miguel Ojeda, linux-kernel

Hi Miguel,

On Thu, Nov 30, 2023 at 7:55 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
> On Wed, Nov 15, 2023 at 10:02 PM Rob Herring <robh@kernel.org> wrote:
> > +       cfg = device_get_match_data(&pdev->dev);
>
> This sounds good to me, but a couple notes:
>
>   - This could be `dev` since we have it, no?

Indeed.

>   - Orthogonally, should we just directly initialize `cfg` since now we can?

Yes we can, it would still fit on an 80-column punched card ;-)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data()
  2023-11-30 18:55 ` Miguel Ojeda
  2023-11-30 19:11   ` Geert Uytterhoeven
@ 2023-12-01 13:39   ` Rob Herring
  2023-12-01 13:49     ` Miguel Ojeda
  1 sibling, 1 reply; 7+ messages in thread
From: Rob Herring @ 2023-12-01 13:39 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Paul Burton, Miguel Ojeda, linux-kernel, Geert Uytterhoeven

On Thu, Nov 30, 2023 at 12:55 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Wed, Nov 15, 2023 at 10:02 PM Rob Herring <robh@kernel.org> wrote:
> >
> > +       cfg = device_get_match_data(&pdev->dev);
>
> This sounds good to me, but a couple notes:
>
>   - This could be `dev` since we have it, no?
>
>   - Orthogonally, should we just directly initialize `cfg` since now we can?
>
> Cc'ing Geert as well since he was the last one touching the file (in
> fact, he added the `dev` variable).

Can you fix that up while applying? This patch has only been ignored
for 2 months.

I really only care about getting the includes right so I can apply this[1].

Rob

[1] https://lore.kernel.org/all/20231129164316.2663565-1-robh@kernel.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data()
  2023-12-01 13:39   ` Rob Herring
@ 2023-12-01 13:49     ` Miguel Ojeda
  2023-12-01 14:20       ` Rob Herring
  0 siblings, 1 reply; 7+ messages in thread
From: Miguel Ojeda @ 2023-12-01 13:49 UTC (permalink / raw)
  To: Rob Herring; +Cc: Paul Burton, Miguel Ojeda, linux-kernel, Geert Uytterhoeven

On Fri, Dec 1, 2023 at 2:39 PM Rob Herring <robh@kernel.org> wrote:
>
> Can you fix that up while applying? This patch has only been ignored
> for 2 months.
>
> I really only care about getting the includes right so I can apply this[1].

Then I would recommend saying that in the patch itself.

If you want to take it in your series to go faster, you can take my:

Acked-by: Miguel Ojeda <ojeda@kernel.org>

If you want me to apply it, that is also fine and I can do so.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data()
  2023-12-01 13:49     ` Miguel Ojeda
@ 2023-12-01 14:20       ` Rob Herring
  2023-12-01 15:50         ` Miguel Ojeda
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2023-12-01 14:20 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Paul Burton, Miguel Ojeda, linux-kernel, Geert Uytterhoeven

On Fri, Dec 1, 2023 at 7:50 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Fri, Dec 1, 2023 at 2:39 PM Rob Herring <robh@kernel.org> wrote:
> >
> > Can you fix that up while applying? This patch has only been ignored
> > for 2 months.
> >
> > I really only care about getting the includes right so I can apply this[1].
>
> Then I would recommend saying that in the patch itself.
>
> If you want to take it in your series to go faster, you can take my:
>
> Acked-by: Miguel Ojeda <ojeda@kernel.org>
>
> If you want me to apply it, that is also fine and I can do so.

Please take it. There's other dependencies already, so I'll be sending
the final patch to Linus at the end of the merge window or after rc1.

Rob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data()
  2023-12-01 14:20       ` Rob Herring
@ 2023-12-01 15:50         ` Miguel Ojeda
  0 siblings, 0 replies; 7+ messages in thread
From: Miguel Ojeda @ 2023-12-01 15:50 UTC (permalink / raw)
  To: Paul Burton, Rob Herring; +Cc: Miguel Ojeda, linux-kernel, Geert Uytterhoeven

On Fri, Dec 1, 2023 at 3:20 PM Rob Herring <robh@kernel.org> wrote:
>
> Please take it. There's other dependencies already, so I'll be sending
> the final patch to Linus at the end of the merge window or after rc1.

Applied, thanks!

Paul: please double-check/test it (I just compile-tested it) and shout
if you do not agree with the change. Otherwise, I will send it to
Linus for the next merge window.

    https://github.com/ojeda/linux/commit/c52391fafcefe4c562bdac62088a2735c185b942

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-12-01 15:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-15 21:02 [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data() Rob Herring
2023-11-30 18:55 ` Miguel Ojeda
2023-11-30 19:11   ` Geert Uytterhoeven
2023-12-01 13:39   ` Rob Herring
2023-12-01 13:49     ` Miguel Ojeda
2023-12-01 14:20       ` Rob Herring
2023-12-01 15:50         ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox