From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A655BC433FE for ; Sat, 22 Oct 2022 13:08:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbiJVNIw (ORCPT ); Sat, 22 Oct 2022 09:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiJVNIv (ORCPT ); Sat, 22 Oct 2022 09:08:51 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D04CA2B7B70 for ; Sat, 22 Oct 2022 06:08:49 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id q19so15400542edd.10 for ; Sat, 22 Oct 2022 06:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jECDV5SqOSdwhazWcoV6YQuDbZ4vuxgoxkQHZLW/d0g=; b=gog/6lwOJlLxETauSPzlW80KFxupVitmXos7FTWhyWiRW3O19zhgcejjE/fj61fobQ +5qsIYusegM8pYW28cT3cTdwg2cVWSBAm5StqJGoQtF/ZiTS4r+3feLpT8FPhvJCg7jz 9A5727kJCxFPeFRycDE2+QFSrICXIKPMloMeOWYa4v1EOPgK3f9uSlADWCRe8VEzlaDl X3XLMbOC2bB2HeT0O0+Xd+UzI7FqQG6VtvoJcZKqfdizdT5gx1SW7pPG38jaALBHSDke VRxYDIqnxpg/WqQJPEjMh0mmX0On0VRyIjL9VTyRwdaOdDntK6+7QZMQm9E52QazceYJ RuQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jECDV5SqOSdwhazWcoV6YQuDbZ4vuxgoxkQHZLW/d0g=; b=SdTF9JTOoETSR6ZB8AUeVFczBvaBuuwgT5G79ILRvYwyYl1CWLhhKV0h5RSyCKvk+h WhYKb+qJfrQtPpZvi64j2ZtkStxOGp49yhCGj6qILCUQTv9GKMP8LcfErAvO/tnDY3v0 +i/jM3G0NLf9hdvo+U1m/voBKroZelFVeLJE427RvOGuVs8BMROcB5AXlapAx765Qg5z XR8NPkQdHOpKemUorWFNzhc01CUuHhQ1fCrosm/A9mHJjYSNtx5nrdiuQHOiFo9+sNKR 3Qe3+ljk5L3SjgUu+1ohgm6EcIca5yvZlhYBE2TyuirwiS/n4RELBzrDifvDQ/YzhYNx 9XaA== X-Gm-Message-State: ACrzQf1XZH945FcgnBE8WcvzqE9VYh8ATGeUPkyhoSxRdXYpWCqTa3PQ Y0uzftUJ1XFgJ/JSzPJE17t/Jg== X-Google-Smtp-Source: AMsMyM4pJJlle/WTj6w/2qTAwH+UF52YWGqi5oyIZCp6k4gzdMQDOZVvztp7Wk7OtpRpnOFttqemqw== X-Received: by 2002:a17:906:8b81:b0:78e:1cb:e411 with SMTP id nr1-20020a1709068b8100b0078e01cbe411mr19355882ejc.681.1666444128303; Sat, 22 Oct 2022 06:08:48 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:25b:e73e:85eb:ae6e? ([2a05:6e02:1041:c10:25b:e73e:85eb:ae6e]) by smtp.googlemail.com with ESMTPSA id l10-20020a1709060cca00b0078d21574986sm12880330ejh.203.2022.10.22.06.08.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Oct 2022 06:08:47 -0700 (PDT) Message-ID: <591f7038-81ed-1850-b525-d02a4e082903@linaro.org> Date: Sat, 22 Oct 2022 15:08:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 3/3] thermal: qcom: tsens: rework debugfs file structure Content-Language: en-US To: Christian Marangi , Amit Kucheria , Thara Gopinath , Andy Gross , Bjorn Andersson , Konrad Dybcio , "Rafael J. Wysocki" , Zhang Rui , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221022125657.22530-1-ansuelsmth@gmail.com> <20221022125657.22530-4-ansuelsmth@gmail.com> From: Daniel Lezcano In-Reply-To: <20221022125657.22530-4-ansuelsmth@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On 22/10/2022 14:56, Christian Marangi wrote: > The current tsens debugfs structure is composed by: > - a tsens dir in debugfs with a version file > - a directory for each tsens istance with sensors file to dump all the > sensors value. s/istance/instance/ The patch looks good to me, no need to resend, I'll fix the typos > This works on the assumption that we have the same version for each > istance but this assumption seems fragile and with more than one tsens > istance results in the version file not tracking each of them. > > A better approach is to just create a subdirectory for each tsens > istance and put there version and sensors debugfs file. > > Using this new implementation results in less code since debugfs entry > are created only on successful tsens probe. > > Signed-off-by: Christian Marangi > --- > drivers/thermal/qcom/tsens.c | 13 +++---------- > 1 file changed, 3 insertions(+), 10 deletions(-) > > diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c > index 467585c45d34..fc12d7c07de4 100644 > --- a/drivers/thermal/qcom/tsens.c > +++ b/drivers/thermal/qcom/tsens.c > @@ -704,21 +704,14 @@ 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) > - debugfs_create_file("version", 0444, priv->debug_root, > - pdev, &dbg_version_fops); > > /* A directory for each instance of the TSENS IP */ > priv->debug = debugfs_create_dir(dev_name(&pdev->dev), priv->debug_root); > + debugfs_create_file("version", 0444, priv->debug, pdev, &dbg_version_fops); > debugfs_create_file("sensors", 0444, priv->debug, pdev, &dbg_sensors_fops); > } > #else -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog