From patchwork Tue Oct 3 11:16:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13407487 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 299B1E7544F for ; Tue, 3 Oct 2023 11:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239921AbjJCLRT (ORCPT ); Tue, 3 Oct 2023 07:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239963AbjJCLRQ (ORCPT ); Tue, 3 Oct 2023 07:17:16 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA027BF for ; Tue, 3 Oct 2023 04:17:11 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20231003111710euoutp014a8e1e8fe136786f6373380bcb1c24fc~KlM-yizpS1147311473euoutp01s for ; Tue, 3 Oct 2023 11:17:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20231003111710euoutp014a8e1e8fe136786f6373380bcb1c24fc~KlM-yizpS1147311473euoutp01s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1696331830; bh=Vg9DFf70aoyV0Kmb3Cb2AWmwbCE2SJj9B9sBvA2HuYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C5tlqEjBZmPORQTzCLzRx8C7titOhRX8qDeSxK+s75TC7O4X0m8x4n1GxwTeiKOW5 IiBlFnY6+jHSs0cFHYN8JSFLwgX71YVRMc22yKAeoWfx6IYG85Ar28CIr40ZRtq30i s3McVxgfork35cUAEDHLmdUQneCWy/AXuvEFNuKs= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20231003111710eucas1p204e1d3274a5bbb029e30898acee06042~KlM-djcw23094430944eucas1p2t; Tue, 3 Oct 2023 11:17:10 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 6B.F7.42423.638FB156; Tue, 3 Oct 2023 12:17:10 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231003111709eucas1p21f2d28615faab2f4aa4d9a264cf7f54f~KlM-AFzO62873528735eucas1p2v; Tue, 3 Oct 2023 11:17:09 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231003111709eusmtrp14a69c0266cc53ac9a752ddb9f6a8a128~KlM_-KruD2246422464eusmtrp1c; Tue, 3 Oct 2023 11:17:09 +0000 (GMT) X-AuditID: cbfec7f2-a51ff7000002a5b7-c6-651bf835d994 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CC.CE.25043.538FB156; Tue, 3 Oct 2023 12:17:09 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231003111708eusmtip29d07bb5541e22c576b800fd54121b136~KlM_LA_L-2772927729eusmtip2I; Tue, 3 Oct 2023 11:17:08 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski Subject: [PATCH v3 4/8] thermal: exynos: handle devm_regulator_get_optional return value correctly Date: Tue, 3 Oct 2023 13:16:30 +0200 Message-ID: <20231003111638.241542-5-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231003111638.241542-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPKsWRmVeSWpSXmKPExsWy7djPc7pmP6RTDV78YrJ4MG8bm8Xh+RUW Ux8+YbP4vuU6k8W8z7IWe19vZbf4dqWDyWLT42usFpd3zWGz+Nx7hNFixvl9TBYTj01mtlh7 5C67xdwvU5ktnjzsY3Pg99g56y67x+I9L5k8Nq3qZPO4c20Pm8fmJfUefVtWMXp83iQXwB7F ZZOSmpNZllqkb5fAlbHw0kymgmMcFVda9rI1MLawdzFyckgImEgsnvqLrYuRi0NIYAWjxKNN XewQzhdGibVfvrNAOJ8ZJc7+Pc4K0/L4yjyoxHJGia7Hd1ghnFYmibmrlrKAVLEJGEg8eLMM bImIQCujxMwmdZAiZoFLzBJ3b64FKxIWSJF4vW4+WBGLgKrEtF+NjCA2r4CtxMPLL9gg1slL 7Fn0nQnE5hSwk1j5czkTRI2gxMmZT8DmMAPVNG+dzQyyQELgP4dEy/l7UO+5SBz718wCYQtL vDq+BSouI3F6cg9UPF9ixub3QDYHkF0hcfegF4RpLfHxDDOIySygKbF+lz5EsaNE76JNjBAV fBI33gpCHMAnMWnbdGaIMK9ER5sQRLWqxPE9k5ghbGmJJy23mSBsD4k7D5pYJzAqzkLyyiwk r8xC2LuAkXkVo3hqaXFuemqxYV5quV5xYm5xaV66XnJ+7iZGYBo7/e/4px2Mc1991DvEyMTB eIhRgoNZSYQ37KhUqhBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFebduTyUIC6YklqdmpqQ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MLA1MLc2MlcR5PQs6EoUE0hNLUrNTUwtSi2D6mDg4pRqY7GSLtD6tSc/a9GjFxwCnU7y3 Tz3VnpL831f+1olbpyS2zyncFiTrvo7/eFHuUbY3ITuumripVKmtuHt94oZHlj5WTzYGT320 pXbmAvX58vf3bMxiDfLzYLn1QElp6WMBzzrpaK+qjXdWfRA2c9A9uFy4zON75TkB4aU1zUuW bLO9UROsKnxU1+jmYU7/5Ph1inE6jN0CXtkSz6yYmOxT2GTO866SuMxc6sX9bfPygPgZ5v43 tIvWfOCYOyXmhaBZYqLiN4E/D9fKfua4uK7A32V2e1lh2QvzVLnafO+Wgz/7p5w9Efl23fKs +I7qVypML0Mbdmd6dq0WYeLm7xX9EXm497vq7tiNS6S2te9WYinOSDTUYi4qTgQAKeRGI0MD AAA= X-CMS-MailID: 20231003111709eucas1p21f2d28615faab2f4aa4d9a264cf7f54f X-Msg-Generator: CA X-RootMTR: 20231003111709eucas1p21f2d28615faab2f4aa4d9a264cf7f54f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231003111709eucas1p21f2d28615faab2f4aa4d9a264cf7f54f References: <20231003111638.241542-1-m.majewski2@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Currently, if regulator is required in the SoC, but devm_regulator_get_optional fails for whatever reason, the execution will proceed without propagating the error. Signed-off-by: Mateusz Majewski Reviewed-by: Krzysztof Kozlowski --- drivers/thermal/samsung/exynos_tmu.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 0e970638193d..6070b03cff9d 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1002,9 +1002,17 @@ static int exynos_tmu_probe(struct platform_device *pdev) return ret; } } else { - if (PTR_ERR(data->regulator) == -EPROBE_DEFER) + ret = PTR_ERR(data->regulator); + switch (ret) { + case -ENODEV: + break; + case -EPROBE_DEFER: return -EPROBE_DEFER; - dev_info(&pdev->dev, "Regulator node (vtmu) not found\n"); + default: + dev_err(&pdev->dev, "Failed to get regulator: %d\n", + ret); + return ret; + } } ret = exynos_map_dt_data(pdev);