Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp609926ybl; Thu, 12 Dec 2019 01:53:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwShhFDw0XMyI52NCsqhvUB0s/cguS9pmvjj9N+Mai3WAf1Gr3eI5xZemQFrW5OjbsJ/0zT X-Received: by 2002:a9d:708f:: with SMTP id l15mr7563223otj.286.1576144391130; Thu, 12 Dec 2019 01:53:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576144391; cv=none; d=google.com; s=arc-20160816; b=0Vi79L+dQsnOJWmY5DShHoQhsu0A4zpGwcHqm/s6Ugh0JuTdsR2ELtuV99cv/bBtTp OuPQRRpX74PztDKne3tM67HB3nktn1SpoZc876QesHfirkdFHZiQyIouLJ4MtpV+42RP IyxS+/sD+HiYbOwSdyGemjDM3E0nX0PcU0HNQAX3mK03d9dLygWd/yjDE6gDYedIw5+C H4WVxjAJVUconwB8LCOoBphlbXO8Ri+C9boxurFoV8LkxTN4raGBwSuJNRb9iIlUKu5f RyzTZvW4s9M+ksS++OwYOOv3jkrXlXUcC/v6Px252St0vKz5y962l1kAzoYWkIXbRoeE u7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Th0Gxjy39UzyWkgaaSlqfUVGyatOKXBlhrJ1etVX5js=; b=fmv26nl2B+CBnxjhnBAo1upzTjQanggSNoZ9sDphw4h3O29gwyCmddl2LZfxlOEj7U amWtALyatGg7SFAnhuQuVShmyKmAd88/Urd8Raqb/Y8wiv0jqSJy9OSZE6MewXSdwjkn ShiCA0dKsm/EaYARKELq2GPKNdV+4vxxtvjqFeQpeW1AjUZvDx0iFqpufdvDeRNLtb2L WFL3poCjVLJhncxXkdocDOr5TaeFdJPPNJuX+3hqkm51LxcQjnNQekzPuZ123ByG3TYv 5G3Wa05UtlCHAk52tABLK8FUt0usrS4NbtgPNsXp/GULNbYT4h04NysiHDdKuTry+/xv MdTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lr4zFJbm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y186si2960010oia.108.2019.12.12.01.52.58; Thu, 12 Dec 2019 01:53:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lr4zFJbm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728423AbfLLJvA (ORCPT + 99 others); Thu, 12 Dec 2019 04:51:00 -0500 Received: from mail-ua1-f65.google.com ([209.85.222.65]:35887 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728400AbfLLJu6 (ORCPT ); Thu, 12 Dec 2019 04:50:58 -0500 Received: by mail-ua1-f65.google.com with SMTP id k33so623027uag.3 for ; Thu, 12 Dec 2019 01:50:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Th0Gxjy39UzyWkgaaSlqfUVGyatOKXBlhrJ1etVX5js=; b=Lr4zFJbm8S7HgAMSDwABkA/wyND+xwdWGQnbqBjKgGo7aCnTiK8exjImHHk9GVigub OaEkvndf8/JCWjrVQnkebzikIg3uTiUuNMj9PK+Hdz5dbj8KOi1h7JaRhq4Ez9J8mYN8 7GY99n0HWRrJq8+wjtLytVQYXZpJHijWwBw8hvMh5YDK0gY9LpzoPD4hzf6bjwToMqTF BXYVG570RYgua0JseTb5oaqV7jIcHoZd6nBTTnYqs1ev1K36YKDKg2oPPhbyY5JbQT6G EQhIA+/kNaa5FMfQh/+KDZ9zr9pZf/sXj42yi6Fu1wwHRpA+yK6HeCzVmaEhNuZBgrh8 Atmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Th0Gxjy39UzyWkgaaSlqfUVGyatOKXBlhrJ1etVX5js=; b=st04N3f8wabBOdk5jIz/7RnshxHfFKMhM4MFcce+0Fw0IB+KapId2RoVTIKpYkIvhI zguYeE66V/TxyVJvZSj4p2VxOy4sezMpKKQ9+7Fb0yJsMeixW6dKV2B1rWDAGiHUDhQJ 0iYoAPYwYKhhonlBoHVaQ01vOHxVaddK1NvREDMnNupy1nd5uOkKgLShiiUyjyoqXNrx tY8QDMjdg/UCQylRh4dQ7VXO7ws5bGkCAIXrv08bNfhJ3rbtrJD3gpNV45vRGKHB68tY vA/mB+tmjd8rYg8Qg7KLiQy9y7ZRgroX0bK/m7HYfLIu7b/z5JJHSB0z4lSF/+Mo7F8P z2Zg== X-Gm-Message-State: APjAAAU/DZEsbIAvZqKob7iBBpBiRcd+cXDRcvND897QBsrC9HulYniv +n6tuGDEZPCSxhtffKH+m8panv1aCcW+BBV1U0ye2g== X-Received: by 2002:ab0:7352:: with SMTP id k18mr7176180uap.77.1576144257519; Thu, 12 Dec 2019 01:50:57 -0800 (PST) MIME-Version: 1.0 References: <39d6b8e4b2cc5836839cfae7cdf0ee3470653b64.1576058136.git.amit.kucheria@linaro.org> In-Reply-To: From: Amit Kucheria Date: Thu, 12 Dec 2019 15:20:44 +0530 Message-ID: Subject: Re: [PATCH] drivers: thermal: tsens: Work with old DTBs To: Daniel Lezcano Cc: LKML , linux-arm-msm , Bjorn Andersson , Andy Gross , Stephen Boyd , Stephan Gerhold , Olof Johansson , Linux PM list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 11, 2019 at 9:42 PM Daniel Lezcano wrote: > > On 11/12/2019 10:58, 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. > > > > Fixes: 634e11d5b450a ("drivers: thermal: tsens: Add interrupt support") > > Signed-off-by: Amit Kucheria > > --- > > drivers/thermal/qcom/tsens.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c > > index 015e7d2015985..d8f51067ed411 100644 > > --- a/drivers/thermal/qcom/tsens.c > > +++ b/drivers/thermal/qcom/tsens.c > > @@ -109,7 +109,7 @@ static int tsens_register(struct tsens_priv *priv) > > > > irq = platform_get_irq_byname(pdev, "uplow"); > > if (irq < 0) { > > - ret = irq; > > 'ret' remains uninitialized here. > > > + dev_warn(&pdev->dev, "Missing uplow irq in DT\n"); > > goto err_put_device; > > } > > > > @@ -118,7 +118,8 @@ static int tsens_register(struct tsens_priv *priv) > > IRQF_TRIGGER_HIGH | IRQF_ONESHOT, > > dev_name(&pdev->dev), priv); > > if (ret) { > > - dev_err(&pdev->dev, "%s: failed to get irq\n", __func__); > > + dev_warn(&pdev->dev, "%s: failed to get uplow irq\n", __func__); > > + ret = 0; > > goto err_put_device; > > } > > The code now is unable to make a distinction between an error in the DT > and the old DT :/ > > Why not version the DT? Versioning the DT is probably overkill for this driver. Just checking for ENXIO as suggested by Stephan seems to be enough. We don't lose the error checking for devm_request_threaded_irq either. Regards, Amit