diff mbox series

[v2] drivers: thermal: tsens: Work with old DTBs

Message ID cea3317c5d793db312064d68b261ad420a4a81b1.1576146898.git.amit.kucheria@linaro.org (mailing list archive)
State Accepted
Commit 344fa0bad6932204146d305607790340f2324a90
Headers show
Series [v2] drivers: thermal: tsens: Work with old DTBs | expand

Commit Message

Amit Kucheria Dec. 12, 2019, 10:38 a.m. UTC
In order for the old DTBs to continue working, the new interrupt code
must not return an error if interrupts are not defined. Don't return an
error in case of -ENXIO.

Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
Suggested-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
---
 drivers/thermal/qcom/tsens.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Bjorn Andersson Dec. 12, 2019, 11:46 p.m. UTC | #1
On Thu 12 Dec 02:38 PST 2019, Amit Kucheria wrote:

> In order for the old DTBs to continue working, the new interrupt code
> must not return an error if interrupts are not defined. Don't return an
> error in case of -ENXIO.
> 
> Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
> Suggested-by: Stephan Gerhold <stephan@gerhold.net>
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> ---
>  drivers/thermal/qcom/tsens.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
> index 015e7d2015985..0e7cf52369326 100644
> --- a/drivers/thermal/qcom/tsens.c
> +++ b/drivers/thermal/qcom/tsens.c
> @@ -110,6 +110,9 @@ static int tsens_register(struct tsens_priv *priv)
>  	irq = platform_get_irq_byname(pdev, "uplow");
>  	if (irq < 0) {
>  		ret = irq;
> +		/* For old DTs with no IRQ defined */
> +		if (irq == -ENXIO)
> +			ret = 0;
>  		goto err_put_device;
>  	}
>  
> -- 
> 2.20.1
>
Daniel Lezcano Dec. 16, 2019, 9:28 a.m. UTC | #2
On 12/12/2019 11:38, Amit Kucheria wrote:
> In order for the old DTBs to continue working, the new interrupt code
> must not return an error if interrupts are not defined. Don't return an
> error in case of -ENXIO.
> 
> Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
> Suggested-by: Stephan Gerhold <stephan@gerhold.net>
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>

Applied.
Amit Kucheria Jan. 1, 2020, 9:15 p.m. UTC | #3
On Mon, Dec 16, 2019 at 2:58 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 12/12/2019 11:38, Amit Kucheria wrote:
> > In order for the old DTBs to continue working, the new interrupt code
> > must not return an error if interrupts are not defined. Don't return an
> > error in case of -ENXIO.
> >
> > Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
> > Suggested-by: Stephan Gerhold <stephan@gerhold.net>
> > Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
>
> Applied.

Hi Daniel,

I haven't seen this fix until -rc4. Do you plan to send it?

Regards,
Amit
Daniel Lezcano Jan. 1, 2020, 9:44 p.m. UTC | #4
On 01/01/2020 22:15, Amit Kucheria wrote:
> On Mon, Dec 16, 2019 at 2:58 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> On 12/12/2019 11:38, Amit Kucheria wrote:
>>> In order for the old DTBs to continue working, the new interrupt code
>>> must not return an error if interrupts are not defined. Don't return an
>>> error in case of -ENXIO.
>>>
>>> Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
>>> Suggested-by: Stephan Gerhold <stephan@gerhold.net>
>>> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
>>
>> Applied.
> 
> Hi Daniel,
> 
> I haven't seen this fix until -rc4. Do you plan to send it?

Hi Amit,

right, I've put it in the thermal/linux-next branch. I'll move it to
thermal/fixes and send a PR tomorrow.
Amit Kucheria Jan. 1, 2020, 10:02 p.m. UTC | #5
On Thu, Jan 2, 2020 at 3:14 AM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> On 01/01/2020 22:15, Amit Kucheria wrote:
> > On Mon, Dec 16, 2019 at 2:58 PM Daniel Lezcano
> > <daniel.lezcano@linaro.org> wrote:
> >>
> >> On 12/12/2019 11:38, Amit Kucheria wrote:
> >>> In order for the old DTBs to continue working, the new interrupt code
> >>> must not return an error if interrupts are not defined. Don't return an
> >>> error in case of -ENXIO.
> >>>
> >>> Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support")
> >>> Suggested-by: Stephan Gerhold <stephan@gerhold.net>
> >>> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> >>
> >> Applied.
> >
> > Hi Daniel,
> >
> > I haven't seen this fix until -rc4. Do you plan to send it?
>
> Hi Amit,
>
> right, I've put it in the thermal/linux-next branch. I'll move it to
> thermal/fixes and send a PR tomorrow.

Thanks.
diff mbox series

Patch

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 015e7d2015985..0e7cf52369326 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -110,6 +110,9 @@  static int tsens_register(struct tsens_priv *priv)
 	irq = platform_get_irq_byname(pdev, "uplow");
 	if (irq < 0) {
 		ret = irq;
+		/* For old DTs with no IRQ defined */
+		if (irq == -ENXIO)
+			ret = 0;
 		goto err_put_device;
 	}