All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Input: ads7846 - Fix usage of match data
@ 2023-06-06 21:34 Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2023-06-06 21:34 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, soc,
	Dmitry Torokhov, linux-omap, linux-input

On Tue, Jun 06, 2023 at 09:13:04PM +0200, Linus Walleij wrote:
> device_get_match_data() returns the match data directly, fix
> this up and fix the probe crash.
> 
> Fixes: 767d83361aaa ("Input: ads7846 - Convert to use software nodes")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Tested-by: Guenter Roeck <linux@roeck-us.net>

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

* Re: [PATCH] Input: ads7846 - Fix usage of match data
  2023-06-06 19:13 Linus Walleij
  2023-06-06 19:15 ` Dmitry Torokhov
@ 2023-06-09 13:10 ` patchwork-bot+linux-soc
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-soc @ 2023-06-09 13:10 UTC (permalink / raw)
  To: Linus Walleij; +Cc: soc

Hello:

This patch was applied to soc/soc.git (for-next)
by Arnd Bergmann <arnd@arndb.de>:

On Tue,  6 Jun 2023 21:13:04 +0200 you wrote:
> device_get_match_data() returns the match data directly, fix
> this up and fix the probe crash.
> 
> Fixes: 767d83361aaa ("Input: ads7846 - Convert to use software nodes")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> 
> [...]

Here is the summary with links:
  - Input: ads7846 - Fix usage of match data
    https://git.kernel.org/soc/soc/c/8f7913c04f6a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH] Input: ads7846 - Fix usage of match data
  2023-06-06 19:13 Linus Walleij
@ 2023-06-06 19:15 ` Dmitry Torokhov
  2023-06-09 13:10 ` patchwork-bot+linux-soc
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2023-06-06 19:15 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, soc,
	linux-omap, linux-input, Guenter Roeck

On Tue, Jun 06, 2023 at 09:13:04PM +0200, Linus Walleij wrote:
> device_get_match_data() returns the match data directly, fix
> this up and fix the probe crash.
> 
> Fixes: 767d83361aaa ("Input: ads7846 - Convert to use software nodes")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
> This patch needs to be applied to the SoC tree where the
> offending patch is residing.
> ---
>  drivers/input/touchscreen/ads7846.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index 40eb27f1b23f..fe6fe8acd8a6 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -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);
> -- 
> 2.34.1
> 

-- 
Dmitry

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

* [PATCH] Input: ads7846 - Fix usage of match data
@ 2023-06-06 19:13 Linus Walleij
  2023-06-06 19:15 ` Dmitry Torokhov
  2023-06-09 13:10 ` patchwork-bot+linux-soc
  0 siblings, 2 replies; 4+ messages in thread
From: Linus Walleij @ 2023-06-06 19:13 UTC (permalink / raw)
  To: Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, soc, Dmitry Torokhov
  Cc: linux-omap, linux-input, Linus Walleij, Guenter Roeck

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

Fixes: 767d83361aaa ("Input: ads7846 - Convert to use software nodes")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
This patch needs to be applied to the SoC tree where the
offending patch is residing.
---
 drivers/input/touchscreen/ads7846.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 40eb27f1b23f..fe6fe8acd8a6 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -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);
-- 
2.34.1


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

end of thread, other threads:[~2023-06-09 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-06 21:34 [PATCH] Input: ads7846 - Fix usage of match data Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2023-06-06 19:13 Linus Walleij
2023-06-06 19:15 ` Dmitry Torokhov
2023-06-09 13:10 ` patchwork-bot+linux-soc

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.