Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2318116pxj; Sun, 13 Jun 2021 16:33:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZQX4SANVkyRLzZ7seMxv4NnJPl07ebSOqCIcoR88/QIZlAttjXwQvKUNA+GqKtBzkzZ/F X-Received: by 2002:a17:906:d791:: with SMTP id pj17mr13011344ejb.442.1623627225716; Sun, 13 Jun 2021 16:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623627225; cv=none; d=google.com; s=arc-20160816; b=B4AonXy9FJgYNaBI0RnWB6mUkYqFi185QtmOPXqj7AXaMwgW0hoOFTou/vPBDCnEst wTO9TlxfVSE+uwcL5FysE9tybCou0IsilJ18xuEvE7dyeIk4Et39CVo4UFSs/JB8VSZP 11QETCpDQ9MJLo/DtBzQ6/Tkyk88dt4049XpGLZ4OPzc1tgyYx+n7D9qHnGoIcdlT1Px shcGvzifaJ54gYY7evOK/jQ8Q/PraCJxVPOor3HXd4cXpCpasNeO4XI0Jubv3C7cyc8j cOa9oF4QMrnRidkFYGmcdtnP8BTlpH9OaDMN2DPzFI4qOxK2QNIJSamy9neaTbo7X1Yk pMXQ== 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=A94ggZZVekVyfiLLJhAqStHmusqip9YekwJs7J8LgkU=; b=SpfiuWvsDPCPqltlzsXOQgjkoIDCQ71EupI6n34UxINmwr5P7YdO8UqORs0V6n1erz U7yCkU8Mmhwze3begoSs3TG53Z6mh7cWfdUcmeC4cQMkpijU0+Q19bmPXQ5MP+zbi5yx Awy4OhlrpOWEYqw88lXkpigz8gKS3ucO5fzZ4nsTgyHW/gJnNcg8vCO+UtGUE6USrWyN ue25ktV8N2wNmZeHL6JonZU5HwESN2s1BoQLnz3yvC9Z/HY+yCsALfAKumJ5zu5h8Kep H4JfluQDnvZD1HV7ZUGKkEdy/QIWJvuPnrXQzgjdJ4grh1xt4tE3sdVPbVaKPnumRvAA xf4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xfr5ZoAy; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v14si1249096edc.521.2021.06.13.16.33.23; Sun, 13 Jun 2021 16:33: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=@gmail.com header.s=20161025 header.b=Xfr5ZoAy; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232230AbhFMXdk (ORCPT + 99 others); Sun, 13 Jun 2021 19:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbhFMXdj (ORCPT ); Sun, 13 Jun 2021 19:33:39 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18130C061574; Sun, 13 Jun 2021 16:31:22 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id b145-20020a1c80970000b029019c8c824054so11750238wmd.5; Sun, 13 Jun 2021 16:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A94ggZZVekVyfiLLJhAqStHmusqip9YekwJs7J8LgkU=; b=Xfr5ZoAyqJioQJl5CeeMz2kGh/MsOu3Q4cseiVi20lQYdyFtoXVyYevDTYxqCEYeXv 4yOIL8b8jPhcmEr8yWtbLASgmkJAN2f2FuJa1B7GxHNrtZ3JyCt7+3SPOL+J+Vpj0Ecj mxlsGRn4w2iZ28uIsJc4zgf9ympfJB/3be641qYN1oN2RyjzMkNKYDhbJ6qaMVPDURk6 GOSGylUQ16fVFksZdJfnF/fHPiSOVeL0C9VUCsnU/Ds6MCx3dcaOZz8KllDbTsSoMfaB beKACiJDej5eGl4H/h1YK6huIKa24PMM+5FQP6X4YeTaQGp/8/6VbNhK70dNWOF2wNY6 2Btg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A94ggZZVekVyfiLLJhAqStHmusqip9YekwJs7J8LgkU=; b=Y1NHlLcHJQPNDMX+HvAZ84pMxD6F9EXDbmDfty1AUA6pfGOKhWXXMqb9dMTk28uGjw 3ye9ssxskCDGh/rCRa9bFuT6NQ8DfSykyd2jOKxJfrVlepLfjrtuTpuW4bCM14ZYHITf J9mADYxA+lLOcPTVezMNOYXofNsBGuSdorlm5+B2zpFRdIMHJsC8DA9ns4s/zlOK1Osn hUjf7Aic5lZ4IpCBpYtL5f2h9MO00YnXGW49R9ImNlvLEvnsrdqW0r2xaiFooJk8SFsK Mts+5jLwFz3v1xHLf8TSaLBTtBNGqFNvgxhLIWcjJ5IhGvbYQtXQyMNqGEnXPWqMugtf hxVw== X-Gm-Message-State: AOAM533VyUQEk9WBBiu3xsqC/RRtpi5AbvxEgfQOHuGLnoFceVVv5I3o aoPyzl8uGsDSacve7I/d4LQ= X-Received: by 2002:a1c:f60f:: with SMTP id w15mr13388987wmc.71.1623627080772; Sun, 13 Jun 2021 16:31:20 -0700 (PDT) Received: from localhost.localdomain ([195.245.23.224]) by smtp.gmail.com with ESMTPSA id i9sm17882511wrn.54.2021.06.13.16.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jun 2021 16:31:20 -0700 (PDT) From: Alexander Sverdlin To: Geert Uytterhoeven , Nikita Shubin , linux-iio@vger.kernel.org Cc: Alexander Sverdlin , Jonathan Cameron , Lars-Peter Clausen , linux-kernel@vger.kernel.org Subject: [PATCH 1/7] iio: ep93xx: Prepare clock before using it Date: Mon, 14 Jun 2021 01:30:35 +0200 Message-Id: <20210613233041.128961-2-alexander.sverdlin@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210613233041.128961-1-alexander.sverdlin@gmail.com> References: <20210613233041.128961-1-alexander.sverdlin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 CPU: 0 PID: 1 Comm: swapper Not tainted 5.13.0-rc5-... #1 Hardware name: Cirrus Logic EDB9302 Evaluation Board [] (unwind_backtrace) from [] (show_stack+0x10/0x18) [] (show_stack) from [] (dump_stack+0x20/0x2c) [] (dump_stack) from [] (__warn+0x98/0xc0) [] (__warn) from [] (warn_slowpath_fmt+0x90/0xc0) [] (warn_slowpath_fmt) from [] (clk_core_enable+0x9c/0xbc) [] (clk_core_enable) from [] (clk_core_enable_lock+0x18/0x30) [] (clk_core_enable_lock) from [] (ep93xx_adc_probe+0xe4/0x1a0) [] (ep93xx_adc_probe) from [] (platform_probe+0x34/0x80) [] (platform_probe) from [] (really_probe+0xe8/0x394) [] (really_probe) from [] (device_driver_attach+0x5c/0x64) [] (device_driver_attach) from [] (__driver_attach+0x7c/0xec) [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xc4) [] (bus_for_each_dev) from [] (driver_attach+0x18/0x24) [] (driver_attach) from [] (bus_add_driver+0x140/0x1cc) [] (bus_add_driver) from [] (driver_register+0x74/0x114) [] (driver_register) from [] (__platform_driver_register+0x18/0x24) [] (__platform_driver_register) from [] (ep93xx_adc_driver_init+0x10/0x1c) [] (ep93xx_adc_driver_init) from [] (do_one_initcall+0x7c/0x1a4) [] (do_one_initcall) from [] (kernel_init_freeable+0x17c/0x1fc) [] (kernel_init_freeable) from [] (kernel_init+0x8/0xf8) [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) ... ep93xx-adc ep93xx-adc: Cannot enable clock ep93xx-adc: probe of ep93xx-adc failed with error -108 Signed-off-by: Alexander Sverdlin --- 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.32.0