Commit c52391fa authored by Rob Herring's avatar Rob Herring Committed by Miguel Ojeda

auxdisplay: img-ascii-lcd: Use device_get_match_data()

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: default avatarRob Herring <robh@kernel.org>
Cc: Paul Burton <paulburton@kernel.org>
Link: https://lore.kernel.org/r/20231115210245.3744589-1-robh@kernel.org
[ As discussed, used `dev` and moved call to `cfg`'s initialization. ]
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 2cc14f52
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/mfd/syscon.h> #include <linux/mfd/syscon.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_address.h> #include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -225,17 +225,11 @@ MODULE_DEVICE_TABLE(of, img_ascii_lcd_matches); ...@@ -225,17 +225,11 @@ MODULE_DEVICE_TABLE(of, img_ascii_lcd_matches);
*/ */
static int img_ascii_lcd_probe(struct platform_device *pdev) 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 device *dev = &pdev->dev;
const struct img_ascii_lcd_config *cfg = device_get_match_data(dev);
struct img_ascii_lcd_ctx *ctx; struct img_ascii_lcd_ctx *ctx;
int err; int err;
match = of_match_device(img_ascii_lcd_matches, dev);
if (!match)
return -ENODEV;
cfg = match->data;
ctx = devm_kzalloc(dev, sizeof(*ctx) + cfg->num_chars, GFP_KERNEL); ctx = devm_kzalloc(dev, sizeof(*ctx) + cfg->num_chars, GFP_KERNEL);
if (!ctx) if (!ctx)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment