Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3463168pxv; Mon, 26 Jul 2021 04:53:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycN8p91lER6gba7xaq44SqhhwmjIeXj44GW/aXeU2bu1gO1b5/+2WfkCLVYH3iRMk7k0g3 X-Received: by 2002:a17:906:c30f:: with SMTP id s15mr7054057ejz.233.1627300425089; Mon, 26 Jul 2021 04:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627300425; cv=none; d=google.com; s=arc-20160816; b=NICl/kMXIR8HUJEhub7NA2ztf0f3Nj58/3Naxf18Lo0ML9q+q9vO2pd0hNkj2leO1n kDMG38xiuymPrK5Ur0+xS3PAbNdafa5W+tSdTMnPVk9iLABNRFnNmpwCnhMJks611hKK CCyflqjUYSl/VBBScHjYzV+849y30xhFn2NVqR1wbhPStstNho4MR8b4G5GOR6x/4NhD wx+CE6lKEfLXWkyQdLkdjgFP8Z/3gEAoo5eBGknLoN7xAMZVfdnhnNOrL8GaoirWvKBF eAGo7bx50m+Om4iM2LVV9xpz07uH2J7ST8YDn4Kh+bls1iYXrl6Id7ZVpLZjumxTZsi+ fgqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DnF8MQlLLy2Du8pOQ2CgiJUliFzPhAEWk31Y4mdc5fE=; b=xQvFOONTRNlpfyh6YjBU75VGd8FoF32ppzBlnXmahDUecr7OFYZIwD6oQ+VDNcRHS9 o1bhWsJMA6QrRC0DI0Kye/B3jBZe+nngzbSk/MW+jkd2dBmbXJyGTbtat1y+SwRIdPTR yJ/QWYV0ot/5f4pO3/68hXXTM8xyEv3Q19VPQgHg6lCDTo+fmQRjgnlEhJwPqlpvnL// paApCvsZiM9IZ2Zsy45OwsWIn/KLBsXCAE8NzIZ28OvrlGSRvMuGkfbkCMo65Rsq/IDv yQiqiWfL7HiBE8OHMHtCuzBOPxY2/mywCx2YJ/zNd/kkKcpPZa1pGVN+QFs3/EkPBTRE og1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maquefel.me header.s=mail header.b="RIR/EJZJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j24si32005804eja.261.2021.07.26.04.53.20; Mon, 26 Jul 2021 04:53:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@maquefel.me header.s=mail header.b="RIR/EJZJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233606AbhGZLLS (ORCPT + 99 others); Mon, 26 Jul 2021 07:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233512AbhGZLLR (ORCPT ); Mon, 26 Jul 2021 07:11:17 -0400 Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A734C061757; Mon, 26 Jul 2021 04:51:46 -0700 (PDT) Received: from iva4-9a39f5a0636f.qloud-c.yandex.net (iva4-9a39f5a0636f.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:3daa:0:640:9a39:f5a0]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 9890950E23AE; Mon, 26 Jul 2021 14:51:43 +0300 (MSK) Received: from iva6-2d18925256a6.qloud-c.yandex.net (iva6-2d18925256a6.qloud-c.yandex.net [2a02:6b8:c0c:7594:0:640:2d18:9252]) by iva4-9a39f5a0636f.qloud-c.yandex.net (mxback/Yandex) with ESMTP id M7dYU4Qwd2-phIarCt7; Mon, 26 Jul 2021 14:51:43 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1627300303; bh=DnF8MQlLLy2Du8pOQ2CgiJUliFzPhAEWk31Y4mdc5fE=; h=In-Reply-To:Message-Id:References:Date:Subject:To:From:Cc; b=RIR/EJZJXAzMfWyImXv/Xc1TkNumL/rqezFPESs02HJFWXw+6cGP1Gs4++SDtL8Iz vgRET/RPSqCHyhnr+IdYFRO0WvgEeRTxnNyf8X+iuEI+HcJdTVIPSFlvFLIZpZoCkn cxhrCuuY1N5MH04IftjB3CfoeHJ/5eb7xgqRy3oQ= Authentication-Results: iva4-9a39f5a0636f.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me Received: by iva6-2d18925256a6.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id PIKatQa27D-pg2Sp7KC; Mon, 26 Jul 2021 14:51:42 +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: 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 1/8] iio: ep93xx: Prepare clock before using it Date: Mon, 26 Jul 2021 14:50:45 +0300 Message-Id: <20210726115058.23729-2-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210726115058.23729-1-nikita.shubin@maquefel.me> References: <20210726115058.23729-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 --- 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; } -- 2.26.2