From patchwork Sat Oct 22 12:56:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 7887 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1193325wrr; Sat, 22 Oct 2022 05:58:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM452ehGZCnSwQ/90DrG2pJNrvfPnxIM/aLxYTkButh808kVZ4+6eA2nTEJNP5eUfOZjXqFS X-Received: by 2002:a17:906:7944:b0:73c:838:ac3d with SMTP id l4-20020a170906794400b0073c0838ac3dmr19817560ejo.242.1666443515864; Sat, 22 Oct 2022 05:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666443515; cv=none; d=google.com; s=arc-20160816; b=t5ODSZgf3pN7n6iYHXA4IalhDtm3KMhcLQg9OeqKXOuaBoAH+yiGkQo7p5gy/gy2MV n4p93XofHvu39TG55Ff19n4kTdrFdn1HjpOjIqXWWstVE7OYP/vhYWHAUF15bellN+AO 6lqsIco2oEe72fY5HkdX6Luv1u12vsV642QpPhnxOaZNDxpBrpbp7Zqo+SBnemB8DbPD yTh/pBZeUY2fp3gDqQyhB8aeu5t0qL4LUhZm0Nh2k54vpmpeYKrK5h2p0GhwLgong9TU 4CovY39HFCYenRicX8YffYsmq81NNs3UAY2Zi9PxlZ0aFx/yhIWHD5C/thiXkiS1TPqu jPpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z7rhD1WXk3L0TCFvw5pkhsK28oe7XUuV2gNiSIm6BKo=; b=vISWCb7Ph1MY2k032ATUIuRvnZcVmrusy6/c2NcV8PC065Afnho7LISvu9Qg5i8/Be nT41A5/n1FYJc7U73d0bnqmGNkRCoz/s7DwunrE8lOvlXLFQ7LZ4Nr1O3a/1OVWYriLf ARTzC7sjpjWzZjqYfw/qRetnx8bmQ7ZIqu7VCr52hOmEao9J6JhfGqQroYW+0r7Uy52M DuwqKkQLlOYQ4LuCeXm5SrPaMOjrEax0sk5iBqKCDE3/qK8Yw2cRZJReFutn3m3336TL BGaTzNCZ5QNDmxdxiqDmtif8PLITJ4uDGv/qkkwBgAFuLl+UaNoYW/xWPnTCAs4OvZ7p 4xag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=esAkwKbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c26-20020a056402159a00b0046189831142si718254edv.7.2022.10.22.05.58.11; Sat, 22 Oct 2022 05:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=esAkwKbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229841AbiJVM5O (ORCPT + 99 others); Sat, 22 Oct 2022 08:57:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbiJVM5M (ORCPT ); Sat, 22 Oct 2022 08:57:12 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A1831E3EC; Sat, 22 Oct 2022 05:57:11 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id m16so15241289edc.4; Sat, 22 Oct 2022 05:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z7rhD1WXk3L0TCFvw5pkhsK28oe7XUuV2gNiSIm6BKo=; b=esAkwKbUQ2Fp7FXLvBIFGLPS8xQkqN/MCR8znYnQ587k2ew1B13CDmrIfKxlE+A1Yh 8HDoPbeYBfwo3DsT35M4ad4fnZqin4fznFbQgnVsFt9GE/3NUo0Ce59M1SwFY0ISuL85 WukPVszZOtG4hEOnPN0Py4lJrpHGHQxLKhcYpaRl0qNvf+iNQfJilgcee/xct/0QZ6ig qYWZQuq33njWgbBOAjK8VnJMjuaGzGEE/7GZqjA7VN95Gwck+CW0GV+i50uR3fWfdGeg umBJl9s4Qt3/YWfjJ+vpB+A4GXGfVe87yA4uoYlJKBfrXkZlA/NmX+H7UyufVfgmbcqg l5EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z7rhD1WXk3L0TCFvw5pkhsK28oe7XUuV2gNiSIm6BKo=; b=6omnLgrTnn6y55G09SCEsZU+22ouVZPVRaYp871tunemdpTBwzpIF9H1QMpEKOOqCN QVqEa3COJSI9rsV7uxx57Z502HRVivHv6lRjJRDfJq2xJH6JJNgmVg7PXJyuWMDMseYH mux7caDzejASfL1nH/OoMKKbDhGgnOicvHrcdbnd0K6wDIKqF9KEbx/tVTr5cKy67j63 HfHQlUk7it9IJV3Y8mhhk9t2KcORN3s6vxPsN+v4ESo+JclP39FG6KtDT1tVP/gNMj/k d+U57dN2SeAAn3jo7RSA1vGv7avnbM/WeISvRbFJcXYUHvdOnVy/T9PgswYPqzSurlqD kkkA== X-Gm-Message-State: ACrzQf0ItWUYM4oadgfEfosCdmFtmk2sCJHxUnREssqYfnsSjNNcy1MG 5MvHqDKI7usljuYky/YFV6E= X-Received: by 2002:a17:907:75c6:b0:79c:d3f4:4a14 with SMTP id jl6-20020a17090775c600b0079cd3f44a14mr5975122ejc.61.1666443429649; Sat, 22 Oct 2022 05:57:09 -0700 (PDT) Received: from localhost.localdomain (93-42-70-134.ip85.fastwebnet.it. [93.42.70.134]) by smtp.googlemail.com with ESMTPSA id t29-20020a056402241d00b0045ce419ecffsm15173970eda.58.2022.10.22.05.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 05:57:09 -0700 (PDT) From: Christian Marangi To: Amit Kucheria , Thara Gopinath , Andy Gross , Bjorn Andersson , Konrad Dybcio , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi , Thara Gopinath Subject: [PATCH v3 1/3] thermal: qcom: tsens: init debugfs only with successful probe Date: Sat, 22 Oct 2022 14:56:55 +0200 Message-Id: <20221022125657.22530-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221022125657.22530-1-ansuelsmth@gmail.com> References: <20221022125657.22530-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747392676044885713?= X-GMAIL-MSGID: =?utf-8?q?1747392676044885713?= calibrate and tsens_register can fail or PROBE_DEFER. This will cause a double or a wrong init of the debugfs information. Init debugfs only with successful probe fixing warning about directory already present. Signed-off-by: Christian Marangi Acked-by: Thara Gopinath --- drivers/thermal/qcom/tsens.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index b1b10005fb28..af688ce4d14d 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -918,8 +918,6 @@ int __init init_common(struct tsens_priv *priv) if (tsens_version(priv) >= VER_0_1) tsens_enable_irq(priv); - tsens_debug_init(op); - err_put_device: put_device(&op->dev); return ret; @@ -1153,7 +1151,11 @@ static int tsens_probe(struct platform_device *pdev) } } - return tsens_register(priv); + ret = tsens_register(priv); + if (!ret) + tsens_debug_init(pdev); + + return ret; } static int tsens_remove(struct platform_device *pdev) From patchwork Sat Oct 22 12:56:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 7888 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1194278wrr; Sat, 22 Oct 2022 06:00:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Gnif16VhJdmnyIlD5AliEt7l79kGTrRFRU3scc62CIxfpXmZB1sl/jwbbFDX+XfXzxMlU X-Received: by 2002:a17:907:8a24:b0:795:bb7d:643b with SMTP id sc36-20020a1709078a2400b00795bb7d643bmr14130827ejc.115.1666443653018; Sat, 22 Oct 2022 06:00:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666443653; cv=none; d=google.com; s=arc-20160816; b=Pk/h6sb3jXfSD7sH4px0nrIPQIOFosI0kNmYaN53OQpyKIRRrl1yFwGpwEuMaHhAPD 0AUILFM6JFY/O3qay/IOVkXfRgovbECDAdbLszVTaNZsJT932GOFrtDo7suobvvNEciS u2J9G45jo15aQTgumY2GmrMXGUvE9RqHV+sCHaeQVN0QXqTzonNjrwDLpD/26Dr1l4zJ 0zVH7tBM0vqcJT7lSZEUnj9dcH7QrRfk1Vqk0EtTDYkekOQmLUtTwhbgW3PvSYT0pC+z AmSIn0oZ5GK681jkEmMqI3KqrvEYfl+/EaPATXyPm4NT2nzAeUlXe6jgUuJ0URBLDCB9 banw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=elZSYe3VbormSDAP7uv9H4cczBV3tZh4oUja1hlsR2Q=; b=ICupPHKDuKamdaXdan4VgyXawwU7QvgE3zWh4MhpM/2UIDWoijyr0j3xb2CtQ1hMlM wM32gTcG/YQTLiSUtv9ugy38A5W3twTQc66DCu8ZM1vT6yih27jmRE62dqqX17ZugMt+ qlRAiYOkKSfYh/M61zL5icbsx+vRLJbPW6YCZfmMqPCr8IBJpht8C6wg5hhYW0dDGvMb uhzzUdO9rjP1Aei5MQ4vh7XwSLpR4+rnrkBe4dmBXdIAxtk3hynDbLbMacyQ7iNi0vU6 +z3PVF0CidEKvMn2mIl8NpaehycJGPF7sSj5ZWEXxTBaAUrutAoq821LfwnMeN5eqbmO to8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GwyVQomA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y102-20020a50bb6f000000b00459aa5aafaesi21261158ede.429.2022.10.22.06.00.26; Sat, 22 Oct 2022 06:00:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GwyVQomA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229886AbiJVM5S (ORCPT + 99 others); Sat, 22 Oct 2022 08:57:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbiJVM5O (ORCPT ); Sat, 22 Oct 2022 08:57:14 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F2922B38C; Sat, 22 Oct 2022 05:57:12 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id a13so15438604edj.0; Sat, 22 Oct 2022 05:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=elZSYe3VbormSDAP7uv9H4cczBV3tZh4oUja1hlsR2Q=; b=GwyVQomAlS8vYmx2ITPLDkpqc3PV5qR/XCYkut01ioy6GM8244F3+2JhfruEja8STG FUSztCJZi6vCpT28wtHY4VLFqJTElNMYw8gmFACKtsgs8hNsaP4CeC1L5va3heoAMawY SZQQdpvzs6ttUtCyKkU9mgZeQQBpnGmVddREnT487+9nY14DZMItEgC6C/eetzdyiJMS LD9l7saXsjjxvmoImhjLZHoHkKaS53lees9iMDh/dR6/4Yif5xFvtlpsrxFUBZkWqYol SErJlRJyfQQT0Pln3duYpIpWTRLndBPOTkJclSJX0UH7ZjLWC2egs/F7wIix0YXHQ0ui RdiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=elZSYe3VbormSDAP7uv9H4cczBV3tZh4oUja1hlsR2Q=; b=UXYi6NbkvVJ0rVnY2ICIXYFfhm/0GOjEIEAW0e9Q3wOedgr6zDO5VOZmcFbVDMZbYu sUPsB5TY/32EDc71fuWt5gXVZfq8dENDv8z3PZJPe1Xxu4G4k6vr15lHGGheZ0II3glb 2Jol4s2yDLvMr+pFOSncn4H1lqDJFPEWD0NxfolWqmQzmrLRRXob9RRkSe/VCQR7/yoo RoxiX0+ygpGjXPr/bFcStIHDNDU85ibmWrJM2hvktVXxr6czmRoSGdCBKSHUIzcp54YL H7Cozw1uu2OWoo0jPMxvmEauMFTF/CwcbHqr3Lgb0ImzzQGVyTmfl7mxRIzSMTsNiFRg CmuA== X-Gm-Message-State: ACrzQf3fJ46NVgVvEti9IcK2wILh3H5Fn44ICYL93rgTFUJBpjm4G0VU 95mEelmewR2aWKPfAvCUBD4= X-Received: by 2002:a17:906:9bc3:b0:78d:816f:3743 with SMTP id de3-20020a1709069bc300b0078d816f3743mr20100171ejc.380.1666443431241; Sat, 22 Oct 2022 05:57:11 -0700 (PDT) Received: from localhost.localdomain (93-42-70-134.ip85.fastwebnet.it. [93.42.70.134]) by smtp.googlemail.com with ESMTPSA id t29-20020a056402241d00b0045ce419ecffsm15173970eda.58.2022.10.22.05.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 05:57:10 -0700 (PDT) From: Christian Marangi To: Amit Kucheria , Thara Gopinath , Andy Gross , Bjorn Andersson , Konrad Dybcio , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v3 2/3] thermal: qcom: tsens: fix wrong version id dbg_version_show Date: Sat, 22 Oct 2022 14:56:56 +0200 Message-Id: <20221022125657.22530-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221022125657.22530-1-ansuelsmth@gmail.com> References: <20221022125657.22530-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747392819919602924?= X-GMAIL-MSGID: =?utf-8?q?1747392819919602924?= For VER_0 the version was incorrectly reported as 0.1.0. Fix that and correctly report the major version for this old tsens revision. Signed-off-by: Christian Marangi --- drivers/thermal/qcom/tsens.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index af688ce4d14d..467585c45d34 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -692,7 +692,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; From patchwork Sat Oct 22 12:56:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 7889 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1195513wrr; Sat, 22 Oct 2022 06:02:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68MbJnoaU7/J4uH1EmlPHvniF8OxgVmbBEdxsNmpL8nt0hiss6nBFGGNBjKdryapr0sj69 X-Received: by 2002:a50:871a:0:b0:461:52a9:1da6 with SMTP id i26-20020a50871a000000b0046152a91da6mr6499368edb.94.1666443775838; Sat, 22 Oct 2022 06:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666443775; cv=none; d=google.com; s=arc-20160816; b=MbUDVZLnaHj3ImIaJyLQEmWul7CmRkvQGJmwCqL3jW0DZkFZB+a4XkLSLPbIPMdd2f xtqhFjV7+08nJlR/apAecJAiZNHPcfCL0z/5qQgoV2grlIyey05aFsMYMotpUmZxtBvw 5X0IlHWWlhm+y8hvbdtoGhiO/Gyl6Nv+ZEhvIZB5doDdKjWa65lr6arKvsjMbWUxjJCo fYtQ/OZEUeDGEYdklLDCdNbWBpaHPAJxrh1BZMqlOA+fMFmH36BFvDtQ6kQc6pytbUUn +lLex9R6+Uwv8T5lIWQ3Ko4PFmLRNPfzQa8jM44mC2u1qM/kEMZzrSjo8pi/OwhbX/Rj MezQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vfeD3Vie7kg8iBMU4bkz+AYFFromxwoh/hIWgeFhX/4=; b=ASfVH1x4fY+M/qmtM9Y+wbyV3A+9p7TF/EKiqEz6RFr727xwjtSkoL1sZ2s/9OmjLC wU43Aj4Wy0xhiLwGxPfAQs/cJhoE/Pd7uplPwoeK5y+hulbDe9wKgKnEWjM+L28KtlQI d/ghUvR4PNgXhRqNpm9ua4zzWI+Essb034S0+/8kT1Q8vyL9h+4bTlQAsjgaPdhciUuS LeIi6wxoTGpmNzjtqH2WAPvrGXYiK2Tvbjo83aTpxGx/PI4Ca1H8b7F+HThoC2JQZqJE 1ai6o8OUYQefxmwNZgBfvOutMIG+KypWRpm7OhTHzcI4qEX4Yr12QcIeHhU8QqzKNHQr D5UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=C25zegeG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a1709060e4700b007315809ec88si19146171eji.399.2022.10.22.06.02.29; Sat, 22 Oct 2022 06:02:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=C25zegeG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbiJVM51 (ORCPT + 99 others); Sat, 22 Oct 2022 08:57:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbiJVM5Q (ORCPT ); Sat, 22 Oct 2022 08:57:16 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 190A822B7AE; Sat, 22 Oct 2022 05:57:15 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id m15so15295125edb.13; Sat, 22 Oct 2022 05:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vfeD3Vie7kg8iBMU4bkz+AYFFromxwoh/hIWgeFhX/4=; b=C25zegeG71PPfAEE2c+D+wLiz7zAx/3KhgWHknRipTMUBTCQNNzbai4ngRH7syML4C Zoi7cwUtl1Gcs3mLf8u2nEd42RZ6TmKYokdY9wce00/FXONAg6+ePfxMI3yKrl0ihnlv jBLDEF6ADT65ExUTwIuaQPj2IFXIIUpfWtFIYhqikSsg095U4mGRVwz6Bqkmb3OxrDYQ wDzdhqmHcdgUpbVRwswZOMknMJAkcjQ4vUf+xFOs86VNIxRiBf9WEEgl63FDSd2PUJrZ eNQ5HVioybp84avkdM3PrK0nT8qNvtMBTnK3eqS/eaI8+2hiUt6bNL/tbSA/1B9ftySj Hgew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vfeD3Vie7kg8iBMU4bkz+AYFFromxwoh/hIWgeFhX/4=; b=D8FFlbr+vaSoZjACpxYxOp/yOu1uW3BnB95l9/RENgQhdD2j8lVqSPum2U2nPKmkC5 r8+JpgR6JOB796qIYwg4Lsr7aqQcRg1tnzj6mQRny3CWGxwCJroOPlRml4LepmNsHKQ0 QE2sCVCEX0Wiy926byDfD94QuN3c1EyeF6PDwGEKWYmkLkWmJUs/lN0PRTxdghtTZDmw FyNHAZo+vhq2pXkETx8RWI7w/ziT/c+dE2zK9FqH+HVFETYD69XZpYJ/gwo6s5nTq7jI 7/kHn246HqAcV9NRTXp4NJuIBGYH6Fb0hTV85uottkgap0jAoRJOZNfC0bv8v0LuMG8t SFdw== X-Gm-Message-State: ACrzQf2K1ygGHvCdlJmtocMFA4wBX71GtfLushBQ6zVOOoLTw59CWGB0 1giWkyCpAZ6UuAo4CWLEf/Q= X-Received: by 2002:a17:906:c152:b0:78d:9dbb:150b with SMTP id dp18-20020a170906c15200b0078d9dbb150bmr18972923ejc.542.1666443433316; Sat, 22 Oct 2022 05:57:13 -0700 (PDT) Received: from localhost.localdomain (93-42-70-134.ip85.fastwebnet.it. [93.42.70.134]) by smtp.googlemail.com with ESMTPSA id t29-20020a056402241d00b0045ce419ecffsm15173970eda.58.2022.10.22.05.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 05:57:12 -0700 (PDT) From: Christian Marangi To: Amit Kucheria , Thara Gopinath , Andy Gross , Bjorn Andersson , Konrad Dybcio , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v3 3/3] thermal: qcom: tsens: rework debugfs file structure Date: Sat, 22 Oct 2022 14:56:57 +0200 Message-Id: <20221022125657.22530-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221022125657.22530-1-ansuelsmth@gmail.com> References: <20221022125657.22530-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747392948599412069?= X-GMAIL-MSGID: =?utf-8?q?1747392948599412069?= 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. 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