From patchwork Fri Oct 21 18:19:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 6925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp847096wrr; Fri, 21 Oct 2022 11:34:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5gK2Ml8qZaqVKN5WkkRBaYBNA10iLDrjVLxs8AzBXT2yFIlt8Qz5SXZ71j4a+n0ymjnZES X-Received: by 2002:a17:90b:4d05:b0:202:ec78:9d73 with SMTP id mw5-20020a17090b4d0500b00202ec789d73mr23669715pjb.103.1666377248090; Fri, 21 Oct 2022 11:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666377248; cv=none; d=google.com; s=arc-20160816; b=e1c2TBK9h2RzQtyTm53LPerH/m2USztMfhZngAZr14cY3yDlKne/4f3Oh9dNeF69q2 2vahgKC1hU2Uxwhvst4q9ur9zkGWCXB4CP/PtmCT5d7qF4XC3NfO5nOkHEi5nw741HHf JCymPKCcZXhKVIx+4FMjcfGS49rT5iH293U8qR6vQx6CHN5RHOUUQ9NS+MWq5FxVuRMI p0wKAcBQeMfMxnfJQg2ivlh0iOUJNTdiuB93IIKu9gTHDNZgiqUna4z58apoUQjbAfqp ccCuvWuEMOQ99kuTf55r8Ay4mO3tOV3au/o4aMYmgCNG6F/5GsEp+Y620ioGvOIusoIi Q6UA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=6Q5dOOnQXsp0I8PekuUzOnV/Jb87rJs8XngVkoGhEg0=; b=n9k9rTnfhjoueJUCOrXYsLsiESZqTk/TCoBfebRqPBdflbvDlr5TCOnCh5EpvQmYgG fPZvkS4BdzzIdO7MldSsY9WY6WpHD7Pr4m4kJVzMVLbEsy12YJ66X50KhNpWqAkFbMef o65+HHnJGk1yv/xEeI6uVTUN5nHYC03db3THFBnURMTt1IRHYnIckD0wxUSCv3/ul+7N C2anG/ZCrPXXpQJwXJfqzxpiNBhVDec842+3xrDbnASWCPBvUXpuPyGQ9x5of9sUFv1K z3WRF3JS9UcpXiIZ8XpTZ8VEMlQ/OZk9KqFMBKjo3UijpJUt1VYVdriteGkF1wYD6/0Z pVKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I3dlYO3Z; 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 t12-20020a63954c000000b0045ff2a2f56dsi25589297pgn.508.2022.10.21.11.33.51; Fri, 21 Oct 2022 11:34:08 -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=I3dlYO3Z; 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 S230218AbiJUSTV (ORCPT + 99 others); Fri, 21 Oct 2022 14:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbiJUSTT (ORCPT ); Fri, 21 Oct 2022 14:19:19 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A99127EAC4; Fri, 21 Oct 2022 11:19:18 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id n12so6198072wrp.10; Fri, 21 Oct 2022 11:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6Q5dOOnQXsp0I8PekuUzOnV/Jb87rJs8XngVkoGhEg0=; b=I3dlYO3Zy2SjhI5EMAEFVEh8am4GOQLfg2FtlnVFvOAbwdabeRekIX0p4ZbWXMRd2y ZhVX48PKJD4JMyRa0KxBAjgyTc7d/pD0Bdu3w6IBmzAiHbFyrejDPn7Aq4Q7ExW6L6Qi U6TwzhdkOG8nrIcZJZVYQuWNYtDYWxopFfU0NYHzpolp61NpdCHbu0p5/XTxwbvqfKWo Mn1no0b6JD9lTrRj3MT3eBGknzdLOmV1ENqH2PE3kmfwKuz/v/qiHL6BsvlpdrXKJh8b LBvMikyH1YF6RlBlczLend0FlxKk3HbFCiWrTIIc//avqO6bpDuC1kJGiGHLw87zis3h 27DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6Q5dOOnQXsp0I8PekuUzOnV/Jb87rJs8XngVkoGhEg0=; b=YKQDY5SO5m0jQlrF9kcVYNjwNXlDFEWTVj6gRyi3EtZucp2XcfmIVZpoUDU/dkWuut aSY/18KFytfxITlhZX74snwztlUG/uRvykdZblvpZgVf7hKSghH6rXqcz3cBjtyzyUZJ HzirQ2GHLnZlIShBQxVB7lyHpzUtcNDQ4yeY40PEXfjeJR+lx+4b85xd1SmU8L5GfajN Xqt7vDnPyFa6t8rKjHqiXPKFRCilU5hgSTbUQwkMEgsszbcrpLddUk2DnORW6PJFCveB eBi7V9CUt0kooTJu40SlGTH2biqpMH2roHpZMIytcLnqp03FfApXWk2Jql1jzGq8k//b A9Dg== X-Gm-Message-State: ACrzQf2eGbFjopdUouKIJ9nOwqYuHZTXmK0hBek2F8yP8VfiXRchi6mI nijWslUSaHi/mZ5ckrlX+Pw= X-Received: by 2002:a5d:648c:0:b0:22e:63be:be09 with SMTP id o12-20020a5d648c000000b0022e63bebe09mr13079397wri.159.1666376356606; Fri, 21 Oct 2022 11:19:16 -0700 (PDT) Received: from localhost.localdomain (93-42-70-134.ip85.fastwebnet.it. [93.42.70.134]) by smtp.googlemail.com with ESMTPSA id j8-20020a05600c1c0800b003c6b7f5567csm11157313wms.0.2022.10.21.11.19.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 11:19:16 -0700 (PDT) From: Christian Marangi To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Amit Kucheria , Thara Gopinath , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi , Thara Gopinath Subject: [RESEND PATCH 1/2] thermal: qcom: tsens: init debugfs only with successful probe Date: Fri, 21 Oct 2022 20:19:05 +0200 Message-Id: <20221021181906.16647-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.37.2 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?1747323189269801835?= X-GMAIL-MSGID: =?utf-8?q?1747323189269801835?= 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index b1b10005fb28..cc2965b8d409 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,12 @@ 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)