Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5751981imm; Tue, 12 Jun 2018 12:44:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFKFMyXaHzuWbryi8eAG9doKvhP6i7QCC4bu1WP37WZerGB8hcvtk0IF0KhGxmAF3D2/IU X-Received: by 2002:a17:902:5e3:: with SMTP id f90-v6mr1848873plf.175.1528832639975; Tue, 12 Jun 2018 12:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528832639; cv=none; d=google.com; s=arc-20160816; b=z6w4ia/y3ZxT0+EjoZoqwdXPzHDFZtfZshyqT2hdb8gHUq1asj5TXrSxEQ7pDDrxfB nFW5Wcvo5crBEVP+id5Nw6EPp93szzJb1FQhTKtTrEtR83dG2k1VOM/lp4/wDU19+4+s eJ0s7cgGzBT8gLBKF3Htqzwcac1NlQYYznSt4HU4DiAx5wlP0/F8NWedXIqM/ncMmShj YL/Vt2GWTNKBL3/ulQkLLC7hQUgY7ekFIJd9Dq08dmV1b+XR91n2VXYJ/LL8g0Djzmfu LKT5YiA+06pbkHXiJNzFgqdV35Jh81ukhcKuQ7TySbnLwrgqiE9XpI1aNnaJPT1iV2/b Sa9Q== 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:arc-authentication-results; bh=pE7G2Jmpz8oQI6dryddEkQgATlm2Fhjorz6xJTcdsN8=; b=cF9QiEVHT2k66F1356euBLnmJNhvr/TC60X6GpTcG3Qelov/LtbBNRyQnXFAWKRRaL zRlOiQG0brT4pd6ozQp0HrhGmTw2R7A5R0mUTwKFKguZ9wQ8KKV8ox5ElmY7a42rBE/m 3lBs02a1oHwB5+rhSa4JxJO4+XZeyKc1gkJ7R6HaiLqBPLTe9QcGMFIctjxTuHTnQeny iw1AuaF/zpzB5FDLpKGSDNPcYVFJyzrFDNnT7UNpeV3eHLWzY5hYdvcFNd+gY5BcORsQ HcZaXtRSecHgWsFqAsB0fZ2UqTsdpiP2EJWkD68INF+DXonURTMAxY2pwuO37OdiO36+ 7S/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NJATUnor; 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 n12-v6si687754pgs.560.2018.06.12.12.43.45; Tue, 12 Jun 2018 12:43:59 -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=@linaro.org header.s=google header.b=NJATUnor; 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 S933517AbeFLTnG (ORCPT + 99 others); Tue, 12 Jun 2018 15:43:06 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:35086 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754146AbeFLTnF (ORCPT ); Tue, 12 Jun 2018 15:43:05 -0400 Received: by mail-pf0-f179.google.com with SMTP id c22-v6so73000pfi.2 for ; Tue, 12 Jun 2018 12:43:05 -0700 (PDT) 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:in-reply-to:user-agent; bh=pE7G2Jmpz8oQI6dryddEkQgATlm2Fhjorz6xJTcdsN8=; b=NJATUnorz31JRCcDoHaI7H2ignLBzder9mBsSZDH7TVCwdLNHj7mLRNv+F74VI4tU2 tWoXedpgTM3V2L3Jq0x/1nDiJxX5LjFFNu/Z9PJqHNMPgPItxSm8DWclQNhpTDME/jx/ nkrziZmZOFTz09ZBH48TXF41Dx4Er1Ixd371s= 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=pE7G2Jmpz8oQI6dryddEkQgATlm2Fhjorz6xJTcdsN8=; b=MGDB4K8IUZoL9mAVV20OkM1C4GkGOQhnwrsER6wMRQzUwQKHYY3lCtxJeYXJdMu0er evbZRpt6FilHJ03TWKaGNCWRF6XuOZ94VHcaIAfPhUS9fQ/T1pOC5bVHh2j4oKU4jJXe LweSdoIhbvHgk6cgwVp6DMMmgtSiHi2fMFaPAyY3hZ6WDincorDL0SBvG+49xDT5iD0I qewU3BP9Qz84Q6mNZWDphWHflvj04WAGyuj3btu3GeB7SrUZP9FKpLU6Aq4DqR6eUb9b f51dG+/uEpcZnn7PmxBGCVtPNfOlsn3T7wwm5hJYg3TAEAcFWdabbqz9b4d/QuX8J+nV GyXw== X-Gm-Message-State: APt69E3sQI1YKRI79+6VtnGvzbf2Itf6nJzyRIDgMSYXaQqfC93vygNK PGsdvGQ2bNHht5l6UpkPkn546g== X-Received: by 2002:a63:6e4e:: with SMTP id j75-v6mr1471643pgc.125.1528832584574; Tue, 12 Jun 2018 12:43:04 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id y18-v6sm1027799pfl.122.2018.06.12.12.43.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Jun 2018 12:43:03 -0700 (PDT) Date: Tue, 12 Jun 2018 12:43:02 -0700 From: Bjorn Andersson To: Amit Kucheria Cc: linux-kernel@vger.kernel.org, rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, edubezval@gmail.com, Zhang Rui , "open list:THERMAL" Subject: Re: [PATCH v2 3/5] thermal: tsens: Move 8996 get_temp() to common code for reuse Message-ID: <20180612194302.GP14924@minitux> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 12 Jun 03:54 PDT 2018, Amit Kucheria wrote: > diff --git a/drivers/thermal/qcom/tsens-8996.c b/drivers/thermal/qcom/tsens-8996.c [..] > static const struct tsens_ops ops_8996 = { > .init = init_common, > - .get_temp = get_temp_8996, > + .get_temp = get_temp_tsens_v2, > }; > > const struct tsens_data data_8996 = { > diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c [..] > +int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp) I like the function name, but it's not really common for tsens, it's just common for tsens v2. Also as patch 4 shows we end up adding a set of essentially empty platform specific files for referencing this function. I would suggest that you instead rename tsens-8996.c to tsens-v2.c, rename ops_8996 to ops_v2 and either add new tsens_data for each platform or simply rename that too to data_v2 which we point to from tsens_table. I think we should take it once step further and add "qcom,tsens-v2" as a valid compatible in tsens_table and make the dts do: comaptible = "qcom,msm8996-tsens", "qcom,tsens-v2"; and compatible = "qcom,sdm845-tsens", "qcom,tsens-v2"; Regards, Bjorn