Linux Input Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register
@ 2019-12-10  9:14 Chuhong Yuan
  2020-01-10 18:30 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-12-10  9:14 UTC (permalink / raw)
  To: unlisted-recipients:; (no To-header on input)
  Cc: Dmitry Torokhov, Maxime Ripard, Chen-Yu Tsai, Hans de Goede,
	Eduardo Valentin, linux-input, linux-arm-kernel, linux-kernel,
	Chuhong Yuan

The driver misses a check for devm_thermal_zone_of_sensor_register().
Add a check to fix it.

Fixes: e28d0c9cd381 ("input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/input/touchscreen/sun4i-ts.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
index 0af0fe8c40d7..742a7e96c1b5 100644
--- a/drivers/input/touchscreen/sun4i-ts.c
+++ b/drivers/input/touchscreen/sun4i-ts.c
@@ -237,6 +237,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct device *hwmon;
+	struct thermal_zone_device *thermal;
 	int error;
 	u32 reg;
 	bool ts_attached;
@@ -355,7 +356,10 @@ static int sun4i_ts_probe(struct platform_device *pdev)
 	if (IS_ERR(hwmon))
 		return PTR_ERR(hwmon);
 
-	devm_thermal_zone_of_sensor_register(ts->dev, 0, ts, &sun4i_ts_tz_ops);
+	thermal = devm_thermal_zone_of_sensor_register(ts->dev, 0, ts,
+						       &sun4i_ts_tz_ops);
+	if (IS_ERR(thermal))
+		return PTR_ERR(thermal);
 
 	writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC);
 
-- 
2.24.0


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

* Re: [PATCH] Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register
  2019-12-10  9:14 [PATCH] Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register Chuhong Yuan
@ 2020-01-10 18:30 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2020-01-10 18:30 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Maxime Ripard, Chen-Yu Tsai, Hans de Goede, Eduardo Valentin,
	linux-input, linux-arm-kernel, linux-kernel

On Tue, Dec 10, 2019 at 05:14:01PM +0800, Chuhong Yuan wrote:
> The driver misses a check for devm_thermal_zone_of_sensor_register().
> Add a check to fix it.
> 
> Fixes: e28d0c9cd381 ("input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register")
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/sun4i-ts.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
> index 0af0fe8c40d7..742a7e96c1b5 100644
> --- a/drivers/input/touchscreen/sun4i-ts.c
> +++ b/drivers/input/touchscreen/sun4i-ts.c
> @@ -237,6 +237,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct device_node *np = dev->of_node;
>  	struct device *hwmon;
> +	struct thermal_zone_device *thermal;
>  	int error;
>  	u32 reg;
>  	bool ts_attached;
> @@ -355,7 +356,10 @@ static int sun4i_ts_probe(struct platform_device *pdev)
>  	if (IS_ERR(hwmon))
>  		return PTR_ERR(hwmon);
>  
> -	devm_thermal_zone_of_sensor_register(ts->dev, 0, ts, &sun4i_ts_tz_ops);
> +	thermal = devm_thermal_zone_of_sensor_register(ts->dev, 0, ts,
> +						       &sun4i_ts_tz_ops);
> +	if (IS_ERR(thermal))
> +		return PTR_ERR(thermal);
>  
>  	writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC);
>  
> -- 
> 2.24.0
> 

-- 
Dmitry

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10  9:14 [PATCH] Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register Chuhong Yuan
2020-01-10 18:30 ` Dmitry Torokhov

Linux Input Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-input/0 linux-input/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-input linux-input/ https://lore.kernel.org/linux-input \
		linux-input@vger.kernel.org
	public-inbox-index linux-input

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-input


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git