From patchwork Mon Nov 20 14:50:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 745570 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 7FDDFC5AE5C for ; Mon, 20 Nov 2023 14:52:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233584AbjKTOwT (ORCPT ); Mon, 20 Nov 2023 09:52:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233171AbjKTOv7 (ORCPT ); Mon, 20 Nov 2023 09:51:59 -0500 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AEAC1710 for ; Mon, 20 Nov 2023 06:51:08 -0800 (PST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231120145104euoutp02163c3d79ccac9ef6e4b39e4500ba2a01~ZXFdKFuv22626426264euoutp02s for ; Mon, 20 Nov 2023 14:51:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231120145104euoutp02163c3d79ccac9ef6e4b39e4500ba2a01~ZXFdKFuv22626426264euoutp02s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1700491864; bh=u+wG+TE9TCSLBpYrR24io87ZkJPG2GggSUyjgW3CH9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gS3qEzMKwSdM1Qp01ulOJXVeVh0kRNqwyaxlarGE+KLpeqfGEt9oFWiiSfbblWaS0 XV2Ofizommu8fb5MDPfhi4Z03p9j4yhsdAL65jHWyWiqWM6Aj0hMgIkT1iuCkK/lqp AFoJln6rZLrgsVaNP9gZp0zvy4pERAgHloXxIRAE= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20231120145103eucas1p1427585615e9e6ede588a86181de6f9e4~ZXFcpRLaU0299402994eucas1p1f; Mon, 20 Nov 2023 14:51:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 36.AB.09814.7527B556; Mon, 20 Nov 2023 14:51:03 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231120145103eucas1p242fd14a2c778c6a47092d5cfdd7f26bf~ZXFcHQbYL0521605216eucas1p2x; Mon, 20 Nov 2023 14:51:03 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231120145103eusmtrp2d1b2f4ee91402f9dce090eb8adb6ecbd~ZXFcGQ1tk0700707007eusmtrp2k; Mon, 20 Nov 2023 14:51:03 +0000 (GMT) X-AuditID: cbfec7f4-711ff70000002656-33-655b725789f5 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 46.C3.09146.6527B556; Mon, 20 Nov 2023 14:51:03 +0000 (GMT) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231120145102eusmtip26b9318118cd499c4cbad186c721576f8~ZXFbNc7Xj1014210142eusmtip2c; Mon, 20 Nov 2023 14:51:02 +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 , Lukasz Luba Subject: [PATCH v5 4/9] thermal: exynos: handle devm_regulator_get_optional return value correctly Date: Mon, 20 Nov 2023 15:50:44 +0100 Message-ID: <20231120145049.310509-5-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231120145049.310509-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOKsWRmVeSWpSXmKPExsWy7djP87rhRdGpBk+/alg8mLeNzeLw/AqL qQ+fsFl833KdyWLeZ1mLva+3slt8u9LBZLHp8TVWi8u75rBZfO49wmgx4/w+JouFTS3sFhOP TWa2WHvkLrvF3C9TmS2ePOxjcxDwWDNvDaPHzll32T0W73nJ5LFpVSebx51re9g8Ni+p9+jb sorR4/MmuQCOKC6blNSczLLUIn27BK6MmRuqCpZwVRy8PYOxgXE3RxcjJ4eEgInE2W8fmboY uTiEBFYwSsx6PZERwvnCKDHpzkIWCOczo8SUc59ZYFrmztzHBpFYzihxb/MZZpCEkEArk8TW PUYgNpuAgcSDN8vYQWwRgVZGiZlN6iANzAJfmSWuvp4P1iAskCLx6PJtVhCbRUBV4svvFrAN vAK2ElP6mtghtslL7Fn0nQnE5hSwk2g78pwNokZQ4uTMJ2D1zEA1zVtnM4MskBDo55S4vHo7 M0Szi8TOa51Qg4QlXh3fAmXLSPzfOZ8Jws6XmLH5PdAgDiC7QuLuQS8I01riI8hfHEDjNSXW 79KHKHaUeLvrNlQxn8SNt4IQB/BJTNo2nRkizCvR0SYEUa0qcXzPJKhTpCWetNyGWukh8fbW HJYJjIqzkLwyC8krsxD2LmBkXsUonlpanJueWmyUl1quV5yYW1yal66XnJ+7iRGY1k7/O/5l B+PyVx/1DjEycTAeYpTgYFYS4f0mFJEqxJuSWFmVWp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qUH19UmpNafIjRFOjsicxSosn5 wDSQVxJvaGZgamhiZmlgamlmrCTO61nQkSgkkJ5YkpqdmlqQWgTTx8TBKdXAtM9mibPCot1i Dr2W856qTZlyP6vJNnJmgUrLTYlnQTGnLNadf8Avqln/jjkzhPvMP6tAwc6zrl3zj3zpnOP0 ObGtomj+fPs1oXqJAlV9JV/3rDvdY860ccrdMEEx59uXf93zU9JY5XDL3vVIwN5GTplJTw4H ZDZvmKy28I/ErLoA6Vn/G9gkHy/aaKoqumrVuXevtj0JfBQp94x5paYdX5zu69qj+U/2PdiW LzTldKpFz4Vz2aLMnAtMdxU+X3f2h+f+4LWaYWZLVvlXFx680v95ScGaWzUf987Y7vfa7sO3 E6xxT5bc4N9ddvf6PYuMxRzub+7/VJlWcdy80yk087BDTtWCNxvCVwo23gl2SVBiKc5INNRi LipOBADKIE1RSwMAAA== X-CMS-MailID: 20231120145103eucas1p242fd14a2c778c6a47092d5cfdd7f26bf X-Msg-Generator: CA X-RootMTR: 20231120145103eucas1p242fd14a2c778c6a47092d5cfdd7f26bf X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231120145103eucas1p242fd14a2c778c6a47092d5cfdd7f26bf References: <20231120145049.310509-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. Meanwhile there is no reason to output the error in case of -ENODEV. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mateusz Majewski --- v3 -> v4: Moved info about not outputting error to the correct commit message. 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 c144592d4584..8bcad8a70dc5 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);