From patchwork Sat Sep 14 18:04:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 13804511 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77797C021A9 for ; Sat, 14 Sep 2024 18:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p3ce3O/r96MZeJG4p40zbk0pdIVvpWH2gPvLROw3NWM=; b=kZpGCaMm2+afOSdNpM5Hc15n1d KRaRWIwcVW2FEax+kJOSsoos37Z0lTcpF1G81EyEq/8g9yP5nS95BLpFIaYbqG36Whl7p+UOW5L9j 9UM767Q4UwnMy76VLDnDRvmJUt+RgIcr9YKI4nrH09Zcgvbhgq/RMjtCjgtIPCwHO+St7T3XpTN1V o+YcWo8NgZGkn4zWBufKZc/yTUmH+vd2OVnRtuPpSmx33ydvHdN3M+2noVtcYclhrRcFF1il4e5x0 9XyRxkFyWaur7AwPQTiRCRrTSOSREcLuZx6SuFeH2xzjZB63pw/a1bB38O+btde3KbJswcMfKdXBl AexKfG6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1spXCZ-0000000152P-45BN; Sat, 14 Sep 2024 18:08:55 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1spX9J-000000014UB-0xYi; Sat, 14 Sep 2024 18:05:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1726337131; bh=dq/7n5tvMY7OuKBFVI6eGVpyHXnigzcGlUpBjIjzYY4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y3BBf5hxlCuSDPu1+AluaS4tOepIRBZjK2FifiEKfkjMNWzP0wmlk6crkFtC+yOAw rYrsXL5Erihlqpk3mkc1kGZP89AkiIk4PGZyiFRirJtQs1F3IjSxCQrhE2q8BV8LXc 0rgv0Io/oWa5pjK7FOkvKHAC6rc+whfkE83diX8P1YijeM836hX+i/69GkDeQNsSGS WhfvyN97K42W977+U1sAnVW2E1bN2u4jNEhdZLFw4u9tdlgmU21JBqxcN+m9h1sLA5 WwnBvb753+J5qwaH3f39dfnkMELZhQbdZRDlzlsxZumEZ2ztYQGvuOG92Jw3bjxxw2 vIG4Amu2XStBA== Received: from localhost (unknown [188.27.55.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id C72A217E360A; Sat, 14 Sep 2024 20:05:31 +0200 (CEST) From: Cristian Ciocaltea Date: Sat, 14 Sep 2024 21:04:55 +0300 Subject: [PATCH 2/4] soc: mediatek: pwrap: Switch to devm_clk_bulk_get_all_enabled() MIME-Version: 1.0 Message-Id: <20240914-clk_bulk_ena_fix-v1-2-ce3537585c06@collabora.com> References: <20240914-clk_bulk_ena_fix-v1-0-ce3537585c06@collabora.com> In-Reply-To: <20240914-clk_bulk_ena_fix-v1-0-ce3537585c06@collabora.com> To: Michael Turquette , Stephen Boyd , Russell King , Matthias Brugger , AngeloGioacchino Del Regno , Jingoo Han , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Alim Akhtar Cc: kernel@collabora.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pci@vger.kernel.org, linux-samsung-soc@vger.kernel.org X-Mailer: b4 0.14.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240914_110533_637441_B270EE7E X-CRM114-Status: GOOD ( 13.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The helper devm_clk_bulk_get_all_enable() is partially broken and will be dropped since it missed to return the number of clocks stored in the clk_bulk_data table referenced by the clks argument. Use the newly introduced devm_clk_bulk_get_all_enabled() variant instead, which is consistent with devm_clk_bulk_get_all() in terms of the returned value: > 0 if one or more clocks have been stored = 0 if there are no clocks < 0 if an error occurred Signed-off-by: Cristian Ciocaltea Reviewed-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-pmic-wrap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c index 9fdc0ef79202..0bcd85826375 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -2518,8 +2518,8 @@ static int pwrap_probe(struct platform_device *pdev) } } - ret = devm_clk_bulk_get_all_enable(wrp->dev, &clk); - if (ret) + ret = devm_clk_bulk_get_all_enabled(wrp->dev, &clk); + if (ret < 0) return dev_err_probe(wrp->dev, ret, "failed to get clocks\n");