From mboxrd@z Thu Jan 1 00:00:00 1970 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 A4525C4338F for ; Mon, 26 Jul 2021 14:01:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84EA960F58 for ; Mon, 26 Jul 2021 14:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234227AbhGZNU5 (ORCPT ); Mon, 26 Jul 2021 09:20:57 -0400 Received: from forward103p.mail.yandex.net ([77.88.28.106]:59448 "EHLO forward103p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233671AbhGZNUz (ORCPT ); Mon, 26 Jul 2021 09:20:55 -0400 X-Greylist: delayed 7749 seconds by postgrey-1.27 at vger.kernel.org; Mon, 26 Jul 2021 09:20:54 EDT Received: from myt5-1892386aa303.qloud-c.yandex.net (myt5-1892386aa303.qloud-c.yandex.net [IPv6:2a02:6b8:c12:4323:0:640:1892:386a]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 11F9D18C2778; Mon, 26 Jul 2021 17:01:22 +0300 (MSK) Received: from myt3-07a4bd8655f2.qloud-c.yandex.net (myt3-07a4bd8655f2.qloud-c.yandex.net [2a02:6b8:c12:693:0:640:7a4:bd86]) by myt5-1892386aa303.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 9yNTtrPB3e-1LI823aw; Mon, 26 Jul 2021 17:01:21 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1627308081; bh=NuHz/YWacClslgKb232VJAShP0Ke4RBK+HwgJRwIaVk=; h=In-Reply-To:References:Date:Subject:To:From:Message-Id:Cc; b=KunjZqRejlkS/p8khjjymZuyU63i6nncL5uX5v17UA3TMWqT+WyNpURBpYX+6roZW CqcoXVBeIT67D+n5C9h1x8d8A9yM8BAlLAUnn0PBBEZIjxi9HOeE7+IOJdVpjulsmr lgZtZuRKI0Zu/K+wvHAORUNsSiC+L43ZQCL9R1PA= Authentication-Results: myt5-1892386aa303.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me Received: by myt3-07a4bd8655f2.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id olJ9yWy468-1K2iqfGp; Mon, 26 Jul 2021 17:01:20 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Nikita Shubin To: Alexander Sverdlin , Geert Uytterhoeven Cc: Nikita Shubin , Jonathan Cameron , Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org (open list:IIO SUBSYSTEM AND DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 1/8] iio: ep93xx: Prepare clock before using it Date: Mon, 26 Jul 2021 16:59:49 +0300 Message-Id: <20210726140001.24820-2-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210726140001.24820-1-nikita.shubin@maquefel.me> References: <20210726115058.23729-1-nikita.shubin@maquefel.me> <20210726140001.24820-1-nikita.shubin@maquefel.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Sverdlin Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch to Common Clock Framework, otherwise the following is visible: WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc Enabling unprepared ep93xx-adc ... Hardware name: Cirrus Logic EDB9302 Evaluation Board unwind_backtrace) from [] (show_stack+0x10/0x18) ... clk_core_enable clk_core_enable_lock ep93xx_adc_probe ... ep93xx-adc ep93xx-adc: Cannot enable clock ep93xx-adc: probe of ep93xx-adc failed with error -108 Signed-off-by: Alexander Sverdlin Acked-by: Jonathan Cameron Signed-off-by: Nikita Shubin --- drivers/iio/adc/ep93xx_adc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ep93xx_adc.c b/drivers/iio/adc/ep93xx_adc.c index c08ab3c6dfaf..5c85257b814c 100644 --- a/drivers/iio/adc/ep93xx_adc.c +++ b/drivers/iio/adc/ep93xx_adc.c @@ -207,7 +207,7 @@ static int ep93xx_adc_probe(struct platform_device *pdev) */ } - ret = clk_enable(priv->clk); + ret = clk_prepare_enable(priv->clk); if (ret) { dev_err(&pdev->dev, "Cannot enable clock\n"); return ret; @@ -215,7 +215,7 @@ static int ep93xx_adc_probe(struct platform_device *pdev) ret = iio_device_register(iiodev); if (ret) - clk_disable(priv->clk); + clk_disable_unprepare(priv->clk); return ret; } @@ -226,7 +226,7 @@ static int ep93xx_adc_remove(struct platform_device *pdev) struct ep93xx_adc_priv *priv = iio_priv(iiodev); iio_device_unregister(iiodev); - clk_disable(priv->clk); + clk_disable_unprepare(priv->clk); return 0; } base-commit: 64376a981a0e2e57c46efa63197c2ebb7dab35df -- 2.26.2