Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2875466imu; Thu, 29 Nov 2018 11:38:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/VPOtq8n4u2SlvuSDDO2o7QmqP/GgEDY8IW5aTQQBFfnmSpItngZs3zZH3NU5KrcS3bDq3s X-Received: by 2002:a62:434d:: with SMTP id q74-v6mr2704686pfa.242.1543520296983; Thu, 29 Nov 2018 11:38:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543520296; cv=none; d=google.com; s=arc-20160816; b=TB7O/BvJ6yWDR4zMau+a8FHn+d7tdbH5LXoao//8BAJOx/XxGwv+wEHtz5i5TCCDLp JT/sbyDpCCOwX1c7Oh6d9TTuvvSbMet24xgDOCD7IQkt/6bdozZ1ukV29sIwgqkgZ1qz SvQG+bnmaNTjSRq/uElltLZlqfgPXHv72B/ziISxlUJUPtMTyKOOTBlHNHmh5Zf7u2fa +QOFj3h3eaWMnyt4gHB5icFpSRyryQMZiajbqNtkuvmEruAtt6yABS2w6gp4fugrzHe9 ftW28HQPDeHES20dOwIUmTnQuUn7hXQJ9ku5Y7Otbe1zMhGEIe06r1ubFXo/hmLSojZw v5Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/vhBMAZb13TEvrf9BZ9cG6Oojk1dBIPBT4c6VDw/Hls=; b=cuSq330xLjTVBIK77tx/2lgvjnMs6OkrNsltEuRyADhrXocpJuFDxn2cbrv9/nXbtL cQ+Eou5dIebKUAmTd5n310uLy/T4fjKfrtFaMJOy/jaNuJEM/aemlFgfIOMM8GyNCHc+ JN9rl2AZo9xCThq3crHyaW/E3p9gLPa//jARtT1zgFfB5hVtYX0z7RI+RqMfgS4WNpxa OXVEoXzuCnFIaDrbVpBV0OsqYfpJ/l5JuWN8LqIWYkMqB9NQFjannzuw3C/IAFBLOEKz V4aoVS0GoKfDq+xTwNBBqoWyjZDE8svbfGtWPmqlIrJKv+k+r8XLag1PjocuUEduxj9I bMGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="bGlUSo/S"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p186si2822072pgp.37.2018.11.29.11.38.01; Thu, 29 Nov 2018 11:38:16 -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=@gmail.com header.s=20161025 header.b="bGlUSo/S"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726646AbeK3Gnd (ORCPT + 99 others); Fri, 30 Nov 2018 01:43:33 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:37542 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbeK3Gnd (ORCPT ); Fri, 30 Nov 2018 01:43:33 -0500 Received: by mail-pl1-f194.google.com with SMTP id b5so1544483plr.4; Thu, 29 Nov 2018 11:37:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/vhBMAZb13TEvrf9BZ9cG6Oojk1dBIPBT4c6VDw/Hls=; b=bGlUSo/S+nIXDBU5INlAzNcphr3fi5yTaCsNHyW4tvWogNLDQIOtbvPn1SgNAAqbsv fM9O9bMxM4mLoy9hKWzwcmeDDZndSGsyADKuQtiywRqSqFpdX2JReSQIpVHUStDPi3Kb qSzsB5RPh4luo53CgihdndujLqYaLnbXijM/rp3tr1lKlo3ZvAeny8rXlChUj2hxjhj9 322Gld/pIOzOanpai+OjCon41SG7aRUq7u1RKW0B3nSn97PUJiE9LkNhiYdGZc3/Xt3t SSQ3SseHGH8/7s82bmx9cWoX1e633ukxh2lYoqT3isBSFXrFi1bgTNEaCZnau7e9/GJd 67pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/vhBMAZb13TEvrf9BZ9cG6Oojk1dBIPBT4c6VDw/Hls=; b=st2wCie3p2Rz3SnfqLGQc8cFmKwQ9IDmofeNOCPnIjc7RugQjnGYFIs6IZYqp6HNb0 FHKEzyxnvSjIyzTZg02gZL959AVr4R/l3tWOcH18+uPHa0BBd7dRoCH6CA2gJccv8tL6 oUot5hM+toi+qREGxTSvos/Mjmwxo3lIh6W2ZoHLnYbL+4/nEpSka1Qrk3LxPqBkGa4I +EFOcWW2Xic75engUehqsTB3mo6845CaC3Jjb085y/odE35hDLW96WjU/CcgXeesazTH pVRKeUzXqEasCatl3QMl0Kx5pJFl3d8Wp1wLXSmonRQox3Ru1GtyZffRHWYPfcWXa7nP xnAQ== X-Gm-Message-State: AA+aEWawuPuYoiTF2eNjDLOAUq2gLwxK3oNvAYYzsC5AwXj5Kv5f6g27 ol3gXrDa+hCUO+aRj/Mass8QVXv2p0I= X-Received: by 2002:a17:902:4124:: with SMTP id e33mr2747816pld.236.1543520222126; Thu, 29 Nov 2018 11:37:02 -0800 (PST) Received: from localhost.localdomain ([2601:644:8201:32e0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id u70sm6910343pfa.176.2018.11.29.11.37.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 11:37:01 -0800 (PST) Date: Thu, 29 Nov 2018 11:36:59 -0800 From: Eduardo Valentin To: Daniel Lezcano Cc: rui.zhang@intel.com, vincent.guittot@linaro.org, john.stultz@linaro.org, "open list:THERMAL" , open list Subject: Re: [PATCH] thermal/drivers/hisi: Fix bad initialization Message-ID: <20181129193658.GA6844@localhost.localdomain> References: <1543516016-28186-1-git-send-email-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1543516016-28186-1-git-send-email-daniel.lezcano@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 07:26:56PM +0100, Daniel Lezcano wrote: > Without this patch, the thermal driver on hi6220 and hi3660 is broken. > > That is due because part of the posted patchset was merged but a small > change in the DT was dropped. > > The hi6220 and hi3660 do not have an interrupt name in the DT, so > finding interrupt by name fails. > > In addition, the hi3660 only defines one thermal zone in the DT and we > are trying to register two sensors assuming we have two thermal zones > in the DT. > > Fix this by adding a couple of line of code to add back compatibility > with older DT and change the sensors number to 1 for the hi3660. Is this a case of adding dt versioning for those nodes? > > Fixes: 2cffaeff083f (thermal/drivers/hisi: Use platform_get_irq_byname) > Signed-off-by: Daniel Lezcano > --- > drivers/thermal/hisi_thermal.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c > index c4111a9..3ab0e63 100644 > --- a/drivers/thermal/hisi_thermal.c > +++ b/drivers/thermal/hisi_thermal.c > @@ -424,7 +424,7 @@ static int hi3660_thermal_probe(struct hisi_thermal_data *data) > struct platform_device *pdev = data->pdev; > struct device *dev = &pdev->dev; > > - data->nr_sensors = 2; > + data->nr_sensors = 1; For bisectability (heh.. is that even a word?), would you please send one fix per patch? > > data->sensor = devm_kzalloc(dev, sizeof(*data->sensor) * > data->nr_sensors, GFP_KERNEL); > @@ -590,8 +590,13 @@ static int hisi_thermal_probe(struct platform_device *pdev) > } > > ret = platform_get_irq_byname(pdev, sensor->irq_name); > - if (ret < 0) > - return ret; > + if (ret <= 0) { Maybe a simple < is enough? reading it seams awkward. From a glance, I dont think platform_get_irq* ever returns 0. > + ret = platform_get_irq(pdev, 0); > + if (ret <= 0) { Same here. > + dev_err(dev, "Failed get interrupt: %d\n", ret); > + return ret; > + } > + } > > ret = devm_request_threaded_irq(dev, ret, NULL, > hisi_thermal_alarm_irq_thread, > -- > 2.7.4 >