Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp150761ybl; Fri, 16 Aug 2019 21:03:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPcPiep+259BAr7SQzw+ULiW9zXQTclnuuACsOgp075HrsmbCjQciwbbMy51YrM9F1NaCg X-Received: by 2002:a17:90a:a789:: with SMTP id f9mr10336158pjq.19.1566014586682; Fri, 16 Aug 2019 21:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566014586; cv=none; d=google.com; s=arc-20160816; b=QqT1QSm9u8D7V68GVaaRaZNKarJz2NzZOJlD1vtRiVMQ0oiyzowDi272IzXZoHylEH t+89NSyQbrg0QUea28Cxs1zSQJlHoR9Gq8b+Q0g+Bec/3TdnR3aHTh9yKvD6UjNorknN +rDYiH5u8UBNByn+tXP7f7TF8j6Y94RIUqJcW9QqraeXdS4fmHNiadkkhAHENTJKrWqw LuepHiUyFPhGF/DinjOlICTq287qu/uVpKKCRQ8hRwWMM5+RYhxoX9l4XW/eDq6lV2bI Qqia6M4iagCaBj3mHDVwqfySdhO+yBaZA3QYLTe9+w2wGzprxJ0b+Io75157Zj5BmAED Qo5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :message-id:dkim-signature; bh=41DUNyHfGDYGOFlacUiPuaR42aKSRfTphWQX5UDtD6o=; b=njimSRs3Z3MdVdXeyWzDCy7piBmFkSb6GIxSGrTq90oAYtgMjfMMe+SMA36GrDQVID VrOtVK838xfMtCS2NScQWUIRCNAXW62ZEaEw8K5e4SqFSN6UmvNPu45G7L83rX92oGf/ ppFT21MhRL2sIXcA1kz8n/pglzU7l7aosANFs2/KjaoCn4tJejqYKbrRdEklqbC79Boz 7tJSCcnAivmkFyuU0DxPwaR9jOZMNY28CROgj0tHuH2ISm5/Q24EZE9lBDXcwCStb/TF jLjLzwZWLxdSdvAV3nKxV5hZIf9gHCGUN2eM3uFZayoUwVxJiQ91xUO5qwjdZ0ZJwoXY kE2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ixPLfl74; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si5347396plt.128.2019.08.16.21.02.52; Fri, 16 Aug 2019 21:03:06 -0700 (PDT) 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=@chromium.org header.s=google header.b=ixPLfl74; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725929AbfHQEB4 (ORCPT + 99 others); Sat, 17 Aug 2019 00:01:56 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41951 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbfHQEB4 (ORCPT ); Sat, 17 Aug 2019 00:01:56 -0400 Received: by mail-pf1-f193.google.com with SMTP id 196so4104176pfz.8 for ; Fri, 16 Aug 2019 21:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=message-id:mime-version:content-transfer-encoding:in-reply-to :references:subject:from:cc:to:user-agent:date; bh=41DUNyHfGDYGOFlacUiPuaR42aKSRfTphWQX5UDtD6o=; b=ixPLfl74xidyeGDAyESYrtkRAaaOMaad+qjnu1XULZZimjYFtEn181iLZpP1ym0gTA PyreXM8okqrfOAAnHjzFtE/FnJKkFAp8pd4+9ldH2Wlq/lH1I1IyQLfzS8xi6udjNbnC tvTGPUZ1nfHWe6ixN8ihl34CXoXxiNO57br9U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version :content-transfer-encoding:in-reply-to:references:subject:from:cc:to :user-agent:date; bh=41DUNyHfGDYGOFlacUiPuaR42aKSRfTphWQX5UDtD6o=; b=FtFGS6MyJ37LsBASvuLOIXtK4A+jjZDmnORzkQbmxGPnKWoTyRBcRjGj8tVYwHdMEW zjQXU3coBGr2+cLFIYrPdX3AW3kaBrp+4m6G1IpqZ+mlDHMarytH4bH8947P97xjfZ+p dbPd7rJ0OX5Il51xaEN4jXcVa6OqZlJ6qc+8IvhxLhwWtEUYncta4xS2Z7IV7aK8w4qd M6ZMDevqCY4tTOF9zZRHd3VfvVqraTyxcw4lGcVpRyy/ph+xst0b5t3Kly3tiYkhqnP2 D/jgRQgoJJQTVY8xgzA+V+6X4WmNjQt06knjbZZYTyWw1m7doSRXvT8plPs2lOwQ7e7C 34Fg== X-Gm-Message-State: APjAAAV0MzVjCZXaXXI/1e2i+VsE57ttnCvfUC5Cgp9vCUUaDRMpQFNU 9tv31b3Cml3YGTAj88rHLnEq/w== X-Received: by 2002:a63:1046:: with SMTP id 6mr10700399pgq.111.1566014515650; Fri, 16 Aug 2019 21:01:55 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id j15sm7429996pfr.146.2019.08.16.21.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2019 21:01:55 -0700 (PDT) Message-ID: <5d577c33.1c69fb81.f966d.6963@mx.google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <9dc86fa912d9b6e21857598ad81ff88564468e5d.1564091601.git.amit.kucheria@linaro.org> References: <9dc86fa912d9b6e21857598ad81ff88564468e5d.1564091601.git.amit.kucheria@linaro.org> Subject: Re: [PATCH 01/15] drivers: thermal: tsens: Get rid of id field in tsens_sensor From: Stephen Boyd Cc: linux-pm@vger.kernel.org To: Amit Kucheria , Andy Gross , Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui , andy.gross@linaro.org, bjorn.andersson@linaro.org, edubezval@gmail.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org User-Agent: alot/0.8.1 Date: Fri, 16 Aug 2019 21:01:54 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Amit Kucheria (2019-07-25 15:18:36) > There are two fields - id and hw_id - to track what sensor an action was > to performed on. This was because the sensors connected to a TSENS IP > might not be contiguous i.e. 1, 2, 4, 5 with 3 being skipped. >=20 > This causes confusion in the code which uses hw_id sometimes and id > other times (tsens_get_temp, tsens_get_trend). >=20 > Switch to only using the hw_id field to track the physical ID of the > sensor. When we iterate through all the sensors connected to an IP > block, we use an index i to loop through the list of sensors, and then > return the actual hw_id that is registered on that index. >=20 > Signed-off-by: Amit Kucheria > --- Nice cleanup! Reviewed-by: Stephen Boyd