From nobody Tue Apr 7 19:30:42 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A42483B4EB5; Thu, 12 Mar 2026 09:29:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773307772; cv=none; b=E5iaVVSSmGNI7qkz3tZq94APAxkRfoB+zWiuz5D6ZCgei7bO4GGidWTu3byv9bEvqTLvIA5QwbxFzkvAch5yiodkYXzYGejXFgTZYXQS7rRkuwN2zvHmU9S7K65qISb7v8l23CvNecoWhYboFGmBC0EDx6enAsgI3i/7VhfWbSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773307772; c=relaxed/simple; bh=LyKS2UfKEPAlA7qoBJVDK8YAcSdArV81Ct/JwFiFDUU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uKo/cq+GAYFJt0Sq9RWMxqGpw6rRY7WtmDhuEFfCQjhqD5tEWsCAamUUGj0EUIh6okjN/J21gJJmsPi8lfHWWxZ9Ih3zkhQW9QINNS/WBW0RiqgCx708DhgXbMjmdK7M5nvBKKjnWqlwjfcQ8XdkcZolldzljES48k2f46YY8Yw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: f55219a21df511f1a21c59e7364eecb8-20260312 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.11,REQID:c2c43a03-6447-42b8-b072-71d50f7845ae,IP:0,U RL:0,TC:0,Content:-5,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:20 X-CID-META: VersionHash:89c9d04,CLOUDID:67f1a4f02718a90d4aececef4621e56a,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|850|898,TC:nil,Content:0|15|50 ,EDM:5,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OS A:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: f55219a21df511f1a21c59e7364eecb8-20260312 X-User: xiaopei01@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 99332158; Thu, 12 Mar 2026 17:29:24 +0800 From: Pei Xiao To: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, openbmc@lists.ozlabs.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, broonie@kernel.org Cc: Pei Xiao Subject: [PATCH 10/17] spi: slave-mt27xx: Use helper function devm_clk_get_enabled() Date: Thu, 12 Mar 2026 17:29:02 +0800 Message-Id: <24ac0d6d499559f6cfe8b35e048ccb9be8bc73ee.1773306858.git.xiaopei01@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables the clocks. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Simplify code. Signed-off-by: Pei Xiao --- drivers/spi/spi-slave-mt27xx.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/spi/spi-slave-mt27xx.c b/drivers/spi/spi-slave-mt27xx.c index ce889cb33228..8ec886918165 100644 --- a/drivers/spi/spi-slave-mt27xx.c +++ b/drivers/spi/spi-slave-mt27xx.c @@ -438,19 +438,13 @@ static int mtk_spi_slave_probe(struct platform_device= *pdev) goto err_put_ctlr; } =20 - mdata->spi_clk =3D devm_clk_get(&pdev->dev, "spi"); + mdata->spi_clk =3D devm_clk_get_enabled(&pdev->dev, "spi"); if (IS_ERR(mdata->spi_clk)) { ret =3D PTR_ERR(mdata->spi_clk); dev_err(&pdev->dev, "failed to get spi-clk: %d\n", ret); goto err_put_ctlr; } =20 - ret =3D clk_prepare_enable(mdata->spi_clk); - if (ret < 0) { - dev_err(&pdev->dev, "failed to enable spi_clk (%d)\n", ret); - goto err_put_ctlr; - } - pm_runtime_enable(&pdev->dev); =20 ret =3D devm_spi_register_controller(&pdev->dev, ctlr); --=20 2.25.1