Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1889728ybv; Fri, 21 Feb 2020 05:13:03 -0800 (PST) X-Google-Smtp-Source: APXvYqz5T07cQho1vod7StxyJ+sBbUy3q01VPcfns9crpfI9ANIQZCcd5gz6jXCSnG3gSGQxr2fl X-Received: by 2002:a9d:6457:: with SMTP id m23mr28657056otl.162.1582290782924; Fri, 21 Feb 2020 05:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582290782; cv=none; d=google.com; s=arc-20160816; b=VvXLHuUwPFPk72GH9zN97rKX7Pca8YZLGRZaBN4KFCimodhzELCqMtMnXwXHlrTsWx 6GGKARCwYDxi4FIHlZ8N8iOyGv7cZqWwv7uCxMXzZ0IPUQ/GREWdKt1xyZZMIGV3dhw6 uiAh5Wx0gFKZdOSOo0dIbJszVaStIQYsTTWRsaxsNzf7Ome5N4CtiZz/pDePPlt+B3e1 yhXkouNCOEiFs68yckzOnnZgrBVkqhyt7jEYdVaptzrP7BHzOiw2oO2Lu1FM40FqPtIu 2fYhu5q/gTsTsNgJe+fkIHnR4XFpAdMmvdZbX6TJVOcDnUZTKCqW/BLe+fn/NlqM+7RB AqVg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=a/KavHLvvULXfL2VP34j+gxXqKWZ5d3n9oQaqLdPQv4=; b=kzY8DVgA6xCTNA2UuAgMxqPA2PhmgnBl+B1mlqm0c87dBFbMbKYgOwWEqFeBAFH4r3 2ooPyo8V1PKk9yCR5JTnw0R0e+UXfPJ9vZM14z5xPGmlSbnxDGSmwxxDYWmFEoe44Nm0 Ny2XesBufesacKLnY1bFT/eTJDFFXOBGn5UFuJZCI2mMzyKM+khbIVWtNzTXyAVrrz6R wcIpqqjOSrjNEnKhThKSn5+nAor8cA4zZtCJ41PB8JUKZUBsKS6juM3QLM8nJk7mO8p8 7cPCEj9LAWyn3LmlnkEpRNXiIiw3RzHS2zHRCSs9WqChi2OBgqWwKHu7qIlMF/5KEwva /lDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eib3Jfwy; 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 y8si731821oih.141.2020.02.21.05.12.41; Fri, 21 Feb 2020 05:13:02 -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=eib3Jfwy; 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 S1728375AbgBUNMd (ORCPT + 99 others); Fri, 21 Feb 2020 08:12:33 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39885 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbgBUNMd (ORCPT ); Fri, 21 Feb 2020 08:12:33 -0500 Received: by mail-wm1-f65.google.com with SMTP id c84so1797264wme.4 for ; Fri, 21 Feb 2020 05:12:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=a/KavHLvvULXfL2VP34j+gxXqKWZ5d3n9oQaqLdPQv4=; b=eib3Jfwyj+tZtw0Vz5eRWnOQiMb9kRoD6q2gN2p55T9aS3rgoCUuv4jkOzgSy6JAgQ LEjM/7bJFu5XAMFaMvFkgF8XI6h8ICSPxck1TJrj6R8L0TLPzxasmiTqaRBEuJSE492o xUPyAD7jB/fuLzt6Z6u8a/djHUo7qip9vuLowvh5OaxbICooz75RPYWXY584WFX80Hsq UecpvDo6HfzMYfFJjPppbxEhywhbLPSsEWUgzWENhmVwerLyCsfebJ75YhAi0BV6oT34 gcEUPT4zy5xBisJiKhATgcWrOM/bv0x40XtU3oXOP8d4vAUNTTge4+2/pCIL965PidD5 SzyA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=a/KavHLvvULXfL2VP34j+gxXqKWZ5d3n9oQaqLdPQv4=; b=ls1AlIN1xKY9W+2C3KAWPPzxdPlHxve8gbsjcD1V62G4CFcm29ouznH/5MkpYXvdTV RYjyMcHgOLZBHhsjmUFqBSRMTt4jvB8phkK6MqcY/r2Cwhnr11h716wzXswDCgvFG3cc LXI5OtgwdmbdOABBO8H08P4ckxZrYc9uo3W2PYuYJRutGVo5HBbuj3cL6S1QwErGGKzV Qdovv9Axb24/2KbfkYc1CYxY+CEkb/6zYDEsd2hGtevhrnwdi5SnusR6Uf+6NDlxk09O 1LUGsQU15QWXR0lC58vSWiw1tgVx8njorUKY/aXEGHIzBmGMVL8D8DetySLLYauah4Nz 6dFA== X-Gm-Message-State: APjAAAU/8IUgk2VT53P+NQ+6sqFGLRufpC0WNMF1cXbNUx7bNRoLAMM7 5gy+XWs2i2ypxZhxQ8E0RO9Y/Q== X-Received: by 2002:a1c:4e02:: with SMTP id g2mr3929356wmh.131.1582290750388; Fri, 21 Feb 2020 05:12:30 -0800 (PST) Received: from linaro.org ([2a01:e34:ed2f:f020:2dfb:b5ce:9043:4adb]) by smtp.gmail.com with ESMTPSA id c15sm3881537wrt.1.2020.02.21.05.12.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Feb 2020 05:12:29 -0800 (PST) Date: Fri, 21 Feb 2020 14:12:26 +0100 From: Daniel Lezcano To: Anson Huang Cc: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "catalin.marinas@arm.com" , "will@kernel.org" , "rui.zhang@intel.com" , "amit.kucheria@verdurent.com" , Aisheng Dong , "linux@roeck-us.net" , "srinivas.kandagatla@linaro.org" , "krzk@kernel.org" , Andy Duan , Peng Fan , Daniel Baluta , "bjorn.andersson@linaro.org" , "olof@lixom.net" , "dinguyen@kernel.org" , Leonard Crestez , "marcin.juszkiewicz@linaro.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" , dl-linux-imx Subject: Re: [PATCH V15 RESEND 2/5] thermal: of-thermal: add API for getting sensor ID from DT Message-ID: <20200221131226.GE10516@linaro.org> References: <1582161028-2844-1-git-send-email-Anson.Huang@nxp.com> <1582161028-2844-2-git-send-email-Anson.Huang@nxp.com> <20200221091112.GA10516@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 21, 2020 at 09:26:29AM +0000, Anson Huang wrote: > Hi, Daniel > > > > * a valid .of_node, for the sensor node. > > > @@ -499,36 +546,22 @@ thermal_zone_of_sensor_register(struct device > > *dev, int sensor_id, void *data, > > > sensor_np = of_node_get(dev->of_node); > > > > > > for_each_available_child_of_node(np, child) { > > > - struct of_phandle_args sensor_specs; > > > int ret, id; > > > > > > /* For now, thermal framework supports only 1 sensor per > > zone */ > > > - ret = of_parse_phandle_with_args(child, "thermal-sensors", > > > - "#thermal-sensor-cells", > > > - 0, &sensor_specs); > > > + ret = thermal_zone_of_get_sensor_id(child, sensor_np, &id); > > > if (ret) > > > continue; > > > > > > - if (sensor_specs.args_count >= 1) { > > > - id = sensor_specs.args[0]; > > > - WARN(sensor_specs.args_count > 1, > > > - "%pOFn: too many cells in sensor specifier %d\n", > > > - sensor_specs.np, sensor_specs.args_count); > > > - } else { > > > - id = 0; > > > - } > > > > Please take also the opportunity to factor out the function > > thermal_zone_of_sensor_register(). > > Sorry, I do NOT quite understand terms "factor out the function ...", could you please advise more detail? Never mind, I realized I puzzled myself with the changes in the series :) Thanks -- Daniel -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog