mbox series

[00/12] thermal/drivers: simplify probe()

Message ID 20240709-thermal-probe-v1-0-241644e2b6e0@linaro.org
Headers show
Series thermal/drivers: simplify probe() | expand

Message

Krzysztof Kozlowski July 9, 2024, 12:59 p.m. UTC
Simplify error handling in probe() and also fix one possible issue in
remove().

Best regards,
Krzysztof

---
Krzysztof Kozlowski (12):
      thermal/drivers/broadcom: fix race between removal and clock disable
      thermal/drivers/broadcom: simplify probe() with local dev variable
      thermal/drivers/broadcom: simplify with dev_err_probe()
      thermal/drivers/exynos: simplify probe() with local dev variable
      thermal/drivers/exynos: simplify with dev_err_probe()
      thermal/drivers/hisi: simplify with dev_err_probe()
      thermal/drivers/imx: simplify probe() with local dev variable
      thermal/drivers/imx: simplify with dev_err_probe()
      thermal/drivers/qcom-spmi-adc-tm5: simplify with dev_err_probe()
      thermal/drivers/qcom-tsens: simplify with dev_err_probe()
      thermal/drivers/generic-adc: simplify probe() with local dev variable
      thermal/drivers/generic-adc: simplify with dev_err_probe()

 drivers/thermal/broadcom/bcm2835_thermal.c | 49 +++++++--------------------
 drivers/thermal/hisi_thermal.c             |  9 ++---
 drivers/thermal/imx_thermal.c              | 42 +++++++++++------------
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c   |  9 ++---
 drivers/thermal/qcom/tsens.c               |  8 ++---
 drivers/thermal/samsung/exynos_tmu.c       | 54 +++++++++++++-----------------
 drivers/thermal/thermal-generic-adc.c      | 27 +++++++--------
 7 files changed, 76 insertions(+), 122 deletions(-)
---
base-commit: 2e0171396caa83c9d908ba2676ba59bce333b550
change-id: 20240709-thermal-probe-a747013ed28d

Best regards,

Comments

Bjorn Andersson July 9, 2024, 7:11 p.m. UTC | #1
On Tue, Jul 09, 2024 at 02:59:39PM GMT, Krzysztof Kozlowski wrote:
> Error handling in probe() can be a bit simpler with dev_err_probe().
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Bjorn Andersson <andersson@kernel.org>

Regards,
Bjorn

> ---
>  drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> index 756ac6842ff9..7c9f4023babc 100644
> --- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> +++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> @@ -829,12 +829,9 @@ static int adc_tm5_get_dt_channel_data(struct adc_tm5_chip *adc_tm,
>  
>  	channel->iio = devm_fwnode_iio_channel_get_by_name(adc_tm->dev,
>  							   of_fwnode_handle(node), NULL);
> -	if (IS_ERR(channel->iio)) {
> -		ret = PTR_ERR(channel->iio);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "%s: error getting channel: %d\n", name, ret);
> -		return ret;
> -	}
> +	if (IS_ERR(channel->iio))
> +		return dev_err_probe(dev, PTR_ERR(channel->iio), "%s: error getting channel\n",
> +				     name);
>  
>  	ret = of_property_read_u32_array(node, "qcom,pre-scaling", varr, 2);
>  	if (!ret) {
> 
> -- 
> 2.43.0
> 
>
Daniel Lezcano July 15, 2024, 9:21 a.m. UTC | #2
On 09/07/2024 14:59, Krzysztof Kozlowski wrote:
> Simplify error handling in probe() and also fix one possible issue in
> remove().
> 
> Best regards,
> Krzysztof
> 
> ---

Applied, thanks