From: Rob Herring <robh@kernel.org>
To: Paul Burton <paulburton@kernel.org>, Miguel Ojeda <ojeda@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data()
Date: Wed, 15 Nov 2023 15:02:44 -0600 [thread overview]
Message-ID: <20231115210245.3744589-1-robh@kernel.org> (raw)
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
next reply other threads:[~2023-11-15 21:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 21:02 Rob Herring [this message]
2023-11-30 18:55 ` [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data() 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
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=20231115210245.3744589-1-robh@kernel.org \
--to=robh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=paulburton@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.