From patchwork Wed Dec 2 23:24:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 11947321 X-Patchwork-Delegate: daniel.lezcano@linaro.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01C9EC6369E for ; Wed, 2 Dec 2020 23:28:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A9C44217A0 for ; Wed, 2 Dec 2020 23:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbgLBX2G (ORCPT ); Wed, 2 Dec 2020 18:28:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbgLBX2F (ORCPT ); Wed, 2 Dec 2020 18:28:05 -0500 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C5ACC0617A6 for ; Wed, 2 Dec 2020 15:27:25 -0800 (PST) Received: by mail-qk1-x731.google.com with SMTP id y197so480954qkb.7 for ; Wed, 02 Dec 2020 15:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=7aljCV+aBW5G6lMmj9SXJiqAnzB6By3HIyFR3aM273U=; b=pqGlMAN6fHB/x2jflm3Ved/oC/LuCFSGw9M2xP3HrVaNdGoB72pyQ+2AbeiE2d5q0q 94ma64Vd72wXGgkrU6RdAogtJWs/m3Jh+MK/1S7YKPoKH7tH8/AmUIt8EPObh8MTFZT+ CcH7+fJqEy/xkLdpFFBkgjDqEMby5NT0u6/jKc/VnM6Idx39bC8prna+6adq/eMSdONI VcqXCGya4Lrz5OAOaKm+BH0E1pc+4eJaYX58mAwZKDCFYR2AzcJmcI4+2E7AOTaR2j70 51E5jkPFdlyhO0n11ZX7ETTGzUUYF8RQFUm12yOA9ICvEu6yE4qrMv1mNokJyLxZwLc4 JhnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7aljCV+aBW5G6lMmj9SXJiqAnzB6By3HIyFR3aM273U=; b=L94sBrTHyJl2cPRDQ1/6tUrCDrwbR/F1W/lGWhS0+2SA6jM0FuiZqyr1A8zLtdmWB8 MqoJNDlKjcXLx8XmwHSejhbIjiNzgBTn5vIvbBRmA3Kfkja1ON22+MfaIXeJQUh1xGcx H6JQ5/PXTxiXOMQg3mnGtp6kH0Q2JCwQS4eQnLdSZIPWoI2Q/ccQOjI/t2HAH6yT680Y TsrJCLPDPgrulNdtIY18y9Ekl3QyRncX6ee1PMJ4d8XRcE+kPmwhTk+SrlHkv0rOZVIB BhnNxf/Ah59fC/XraAVw7LNDIZ8lD+cj+gM70WQql64CfNch9iNUE7L/1DA9dlnn1GcM 8YMA== X-Gm-Message-State: AOAM532xxWhB8l968lfHRtbyo7dAjLPvWUtRcwDldnu//az9KWiReu5O kfllLwV2DUgNCLW9o9KmeuY= X-Google-Smtp-Source: ABdhPJy1MZHb79RNgRUlriSJHBZl4k+uGbihVVCCUROxFd+iaTaSWEeSdj+E58tQ56u3o2BFqcbJ0g== X-Received: by 2002:ae9:e8d1:: with SMTP id a200mr225603qkg.142.1606951644653; Wed, 02 Dec 2020 15:27:24 -0800 (PST) Received: from localhost.localdomain ([177.194.72.74]) by smtp.gmail.com with ESMTPSA id u15sm145079qkj.122.2020.12.02.15.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 15:27:23 -0800 (PST) From: Fabio Estevam To: daniel.lezcano@linaro.org Cc: Anson.Huang@nxp.com, linux-pm@vger.kernel.org, Fabio Estevam Subject: [PATCH 1/2] thermal: imx8mm: Print the correct error code Date: Wed, 2 Dec 2020 20:24:47 -0300 Message-Id: <20201202232448.2692-1-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Currently the error message does not print the correct error code. Fix it by initializing 'ret' to the proper error code. Signed-off-by: Fabio Estevam --- drivers/thermal/imx8mm_thermal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c index a1e4f9bb4cb0..ce7cb6452c52 100644 --- a/drivers/thermal/imx8mm_thermal.c +++ b/drivers/thermal/imx8mm_thermal.c @@ -166,10 +166,11 @@ static int imx8mm_tmu_probe(struct platform_device *pdev) &tmu->sensors[i], &tmu_tz_ops); if (IS_ERR(tmu->sensors[i].tzd)) { + ret = PTR_ERR(tmu->sensors[i].tzd); dev_err(&pdev->dev, "failed to register thermal zone sensor[%d]: %d\n", i, ret); - return PTR_ERR(tmu->sensors[i].tzd); + return ret; } tmu->sensors[i].hw_id = i; } From patchwork Wed Dec 2 23:24:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 11947323 X-Patchwork-Delegate: daniel.lezcano@linaro.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F067C64E7C for ; Wed, 2 Dec 2020 23:28:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D01B8221EB for ; Wed, 2 Dec 2020 23:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbgLBX2I (ORCPT ); Wed, 2 Dec 2020 18:28:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726735AbgLBX2I (ORCPT ); Wed, 2 Dec 2020 18:28:08 -0500 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE58EC0617A7 for ; Wed, 2 Dec 2020 15:27:27 -0800 (PST) Received: by mail-qt1-x842.google.com with SMTP id d5so129705qtn.0 for ; Wed, 02 Dec 2020 15:27:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JBsG2gqms6k1/NKruMGhQYLKhSpaMmXTIrcWtGyhJEE=; b=BM+6pEuL9dxl/Vf4Pa0yU6Af03e9RLkNMaZrzLUITPfVIDJHV9ooHg67uYgH88reOY +lm5Afna12VVfi0o/AFS+3PsRqe+kWm9mA/SUKp1inonnbfNTiKrFL/NeYYg3qWS9B7w PVrdGODPczNuk/XCeE/EiGeUtiHNeNjKT9SaA4srACJ90QzsmfeA839AXkpxPxPZJUnQ 8dAR6jCsmR86AowScd9USvRNRx4daJVmIovT/ZjS9Hd1EbMncxoVqWr+mJLaeiD3XNnj xiEpVTo99edPcQnswRSLYwWix3nL5srVHqu5MtLq5FtW4hHpUf4KmM+TfNmRpDnQgXby 5k7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JBsG2gqms6k1/NKruMGhQYLKhSpaMmXTIrcWtGyhJEE=; b=eG0nbOZuOFwEm6qm0i6eVxLZN6MhlFZgids02RsycybsTPU3ZcS0j94VSDyi6lZdbP dJ1rHtVy7zLAtIV4A7CrTtIPyq2r8EAfATMv0qLtwFHeeYFr6PWZYSraWmAc5fwOjlhd kwSaD3QsJ/ldJlTASn2u8lNdGKSPY9mUzNE5b3WGRUyYwPeRCtBPwxjeVgl54+FYqypg bmC6Tx5w7VwTywdBpCtyGNSuAiRXbVwgtWULtZdc5EQg+W8g4HrNQRKNrWmdHjmB1o9k zjaO4GOcxRhd9KareeeD0lPkkGzyqFhgzhJSPJbhE2RKArvtbKqlUbCSPLiL5UgC3DQ2 1wDg== X-Gm-Message-State: AOAM532bHLwqWmHKKArvdVpuoBVUjOr03fWaI7BkQuFxAHox254Cvv72 1tlJ1gi0zXWtQINJs2s3MZuyn/jr0NfQEg== X-Google-Smtp-Source: ABdhPJwjGlJR1SQdLy9GujC3EcKIPFsZ/YyKqkVApF3htyQt9me7g7K/+gMUB68isxc6x02JtzTBzA== X-Received: by 2002:aed:2393:: with SMTP id j19mr598475qtc.23.1606951647132; Wed, 02 Dec 2020 15:27:27 -0800 (PST) Received: from localhost.localdomain ([177.194.72.74]) by smtp.gmail.com with ESMTPSA id u15sm145079qkj.122.2020.12.02.15.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 15:27:26 -0800 (PST) From: Fabio Estevam To: daniel.lezcano@linaro.org Cc: Anson.Huang@nxp.com, linux-pm@vger.kernel.org, Fabio Estevam Subject: [PATCH 2/2] thermal: imx8mm: Disable the clock on probe failure Date: Wed, 2 Dec 2020 20:24:48 -0300 Message-Id: <20201202232448.2692-2-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201202232448.2692-1-festevam@gmail.com> References: <20201202232448.2692-1-festevam@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Prior to returning an error in probe, disable the previously enabled clock. Signed-off-by: Fabio Estevam --- drivers/thermal/imx8mm_thermal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c index ce7cb6452c52..7442e013738f 100644 --- a/drivers/thermal/imx8mm_thermal.c +++ b/drivers/thermal/imx8mm_thermal.c @@ -170,7 +170,7 @@ static int imx8mm_tmu_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to register thermal zone sensor[%d]: %d\n", i, ret); - return ret; + goto disable_clk; } tmu->sensors[i].hw_id = i; } @@ -185,6 +185,10 @@ static int imx8mm_tmu_probe(struct platform_device *pdev) imx8mm_tmu_enable(tmu, true); return 0; + +disable_clk: + clk_disable_unprepare(tmu->clk); + return ret; } static int imx8mm_tmu_remove(struct platform_device *pdev)