Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2575090pxj; Mon, 10 May 2021 06:14:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIX9eJcBb+WcY0qdvlsNgki3J7yEbrM2QkueTzf6nCOqhzwGzvDH1Pp1G41f5F5oRdJl2n X-Received: by 2002:a17:907:9612:: with SMTP id gb18mr25943121ejc.408.1620652453119; Mon, 10 May 2021 06:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620652453; cv=none; d=google.com; s=arc-20160816; b=oSHL0LLFBTG6i+KuhZwPYAEPLbfj6ttzMntLNvAlm+yKiZe+T1o8eM8Igugy9xe0Cx lhtFxvMf+hmaD+eJCeAxJ4P3kjgHadBtmBlYYMttT0Gkc+I1vL6dWjwjM1rERcDkQ0qz dAVhJuzwXXmAK/F+B+PVMA06jRR0BnnlMRDWBYt6LKQDHlB4VY6Au9YW9jJ97IX8AZPt 746Se7ppquAPO+2j/wE8SEyay1SdLXPBs4mpyG7GjXItAGHD+UCQdQQhEgYP403g60m0 4SP0mSSGwMLdubHqBQ7Gb/Vm0wKCZwf8gZz3XzOS4LqUMMFI9l3cwgvCX6qtY4gwALSJ Tmbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=yJZh56rU3bYx3u0hyhnSmYJm+7oluLwY5PsDMkWTwj8=; b=0RCm+1I6h5a3NSet0PxN3ygqvpd9LzPIcIeJHK4fm2UduSON2hq84sbKX5U6bShRYe pooiDHQuALZZFewoEQJpRoxScfBjrnlnNi+0YvGm+amIsHTBBk6MCZWRjxljWIKRqS2O ZfHlN48FiWNCfNrjsJE4lEZD06f71wz+9lSHUKrcmi+3UHpkGGqsg/CP1D6Xz3k3qD9o Iunn/trnutaRiBkHB0oOQizG1VVC+q6HJDofJ4RmQ7wwaXhby22XzXyP48Ydah9YLIQu 2GsvdNXObX5pPWCQmGrx8kdUDiHeQXog8niAPYG68JdaHzanfs8tysGp+Av599OAvGiT EC9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dTD7X4qI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u11si13838136eds.79.2021.05.10.06.13.39; Mon, 10 May 2021 06:14:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dTD7X4qI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1351169AbhEJNDC (ORCPT + 99 others); Mon, 10 May 2021 09:03:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349667AbhEJMtw (ORCPT ); Mon, 10 May 2021 08:49:52 -0400 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94E17C06138D for ; Mon, 10 May 2021 05:44:50 -0700 (PDT) Received: by mail-qv1-xf36.google.com with SMTP id l19so8174182qvu.8 for ; Mon, 10 May 2021 05:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=yJZh56rU3bYx3u0hyhnSmYJm+7oluLwY5PsDMkWTwj8=; b=dTD7X4qIOIW3q0wnQpu5kBaqCx0W1aLhKu9OI27JNbz8W1AMe4smiu22nLshqX1a2q EvM7yVOK23HKGKjBtvtWPVqL6hxaL0QS6mCGIHLZJRswSm0uvAblgBxyOgyfxFuwHd3D qnV8CwF1/83ZO3dFpVMs5U3yrI8vnUHr8PTCg5sLMSZi94FWRf9/Cbr1g8czyrzcxSRv jPy6LPAAIjyOrPoZLPNNFeRykjHnojG/wE9qI8VMjZ/HPgG878lXlz86OENfDVUDnF+a rxqkhDZoyASdeH/GJ1al729dx4GbqRZ5KceBI/35iTepDgoUrTxhsLl0J5aW9GigPCa4 vmYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yJZh56rU3bYx3u0hyhnSmYJm+7oluLwY5PsDMkWTwj8=; b=MUx26e5UOr9gd6oQ6Pha+HlaKBzk2DFVHOnOAfq4h3QgH+Ce6G61tbY+ZxdTz+SKKA TG6ceqm4mH+coWBMGcYgyMgiBHJAcQDbw0Vcn3S0d25eLbuTHPNnsXIl76XZvftmUXQV BOHeXdZGAzsHp+Qj4V0BQvoD7AyjCJjS2xv92U+Iu/XEY4EfVK1bFoahpiztqw6iBfrr X5mDxwJXy6/6yRqZ5D8NkvczLZ70pWfM4LDEY3hL+abfTVZsQB/XoRWwFbLVXvKxgzEm Er97hJNRjFIVFRYfxlpCfeOf7gvfv4qcrzeSVNQpPwGpUUQKtOQ2Ud6vwRyxYh7vgUwL M+fg== X-Gm-Message-State: AOAM531Ja8ywpunvhVTz82f0G9lJ3U/CGiasnV8NYCVvcu8DPbyGTUzc sDusZRXRw9og94gbwM/VMgTm9cj2ee0nI7V0 X-Received: by 2002:a0c:f808:: with SMTP id r8mr9686322qvn.18.1620650689313; Mon, 10 May 2021 05:44:49 -0700 (PDT) Received: from [192.168.1.93] (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.gmail.com with ESMTPSA id l16sm11425151qkg.91.2021.05.10.05.44.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 May 2021 05:44:48 -0700 (PDT) Subject: Re: [thermal-next PATCH v2 2/2] thermal: qcom: tsens: simplify debugfs init function To: Ansuel Smith Cc: Amit Kucheria , Andy Gross , Bjorn Andersson , Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210429010518.13319-1-ansuelsmth@gmail.com> <20210429010518.13319-3-ansuelsmth@gmail.com> From: Thara Gopinath Message-ID: <6fe0749e-e0e1-6094-e000-7b12f6c7b71d@linaro.org> Date: Mon, 10 May 2021 08:44:46 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210429010518.13319-3-ansuelsmth@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/28/21 9:05 PM, Ansuel Smith wrote: > Simplify debugfs init function. > - Add check for existing dev directory. > - Fix wrong version in dbg_version_show (with version 0.0.0, 0.1.0 was > incorrectly reported) > > Signed-off-by: Ansuel Smith Acked-by: Thara Gopinath Warm Regards Thara > --- > drivers/thermal/qcom/tsens.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c > index b37d5fd71f3a..e43898bf3199 100644 > --- a/drivers/thermal/qcom/tsens.c > +++ b/drivers/thermal/qcom/tsens.c > @@ -657,7 +657,7 @@ static int dbg_version_show(struct seq_file *s, void *data) > return ret; > seq_printf(s, "%d.%d.%d\n", maj_ver, min_ver, step_ver); > } else { > - seq_puts(s, "0.1.0\n"); > + seq_printf(s, "0.%d.0\n", priv->feat->ver_major); > } > > return 0; > @@ -669,16 +669,12 @@ DEFINE_SHOW_ATTRIBUTE(dbg_sensors); > static void tsens_debug_init(struct platform_device *pdev) > { > struct tsens_priv *priv = platform_get_drvdata(pdev); > - struct dentry *root, *file; > > - root = debugfs_lookup("tsens", NULL); > - if (!root) > + priv->debug_root = debugfs_lookup("tsens", NULL); > + if (!priv->debug_root) > priv->debug_root = debugfs_create_dir("tsens", NULL); > - else > - priv->debug_root = root; > > - file = debugfs_lookup("version", priv->debug_root); > - if (!file) > + if (!debugfs_lookup("version", priv->debug_root)) > debugfs_create_file("version", 0444, priv->debug_root, > pdev, &dbg_version_fops); > >