Commit 8f7913c0 authored by Linus Walleij's avatar Linus Walleij Committed by Arnd Bergmann

Input: ads7846 - Fix usage of match data

device_get_match_data() returns the match data directly, fix
this up and fix the probe crash.

Fixes: 767d8336 ("Input: ads7846 - Convert to use software nodes")
Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20230606191304.3804174-1-linus.walleij@linaro.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 0b47a62e
......@@ -1117,20 +1117,13 @@ MODULE_DEVICE_TABLE(of, ads7846_dt_ids);
static const struct ads7846_platform_data *ads7846_get_props(struct device *dev)
{
struct ads7846_platform_data *pdata;
const struct platform_device_id *pdev_id;
u32 value;
pdev_id = device_get_match_data(dev);
if (!pdev_id) {
dev_err(dev, "Unknown device model\n");
return ERR_PTR(-EINVAL);
}
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return ERR_PTR(-ENOMEM);
pdata->model = (unsigned long)pdev_id->driver_data;
pdata->model = (u32)device_get_match_data(dev);
device_property_read_u16(dev, "ti,vref-delay-usecs",
&pdata->vref_delay_usecs);
......
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