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=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 F238CC43331 for ; Sun, 29 Mar 2020 13:34:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA840206DB for ; Sun, 29 Mar 2020 13:34:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="03Bz54I1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728071AbgC2NeP (ORCPT ); Sun, 29 Mar 2020 09:34:15 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:37584 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727903AbgC2NeP (ORCPT ); Sun, 29 Mar 2020 09:34:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3C6tfF5Ul0fw3udMKyjvurS5QtWeo4pSfQAUnxBXyAY=; b=03Bz54I1bcN1+oZhNl0RWIA7u u3TIb2qtWRgALFddvdLJWDf7InsOpmxtRXdcZ1dwuIOpiPmx0j260PDH/if+o1UzW7tIxAnq13lFd fvhpP1mjLMojQk/HeUD9b3FSpxA0yPsfZLfv9b708+JMhVVmdbSzgGK9Tc2nUefUTxLNB5Ivf9rcs o1zpN4AvMfErLybwHlRByrvaZji4ZinfC+USvfYA86CCmw6UkYq44reUM/6Ur/OUzZ1fjs8nRtM8A 5wK3x/1Heaz/S9iArQvPpmrBi2r/viaaElG9n/3aHa8119Z74J/z2wHNtPNm9Cis+F/qsmzIBVZIT JhjFr68WQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:42932) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jIY4i-0005E4-F2; Sun, 29 Mar 2020 14:34:04 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jIY4e-0006FN-8B; Sun, 29 Mar 2020 14:34:00 +0100 Date: Sun, 29 Mar 2020 14:34:00 +0100 From: Russell King - ARM Linux admin To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Mark Rutland , Andrew Lunn , Jason Cooper , devicetree@vger.kernel.org, Linus Walleij , linux-pwm@vger.kernel.org, Bartosz Golaszewski , Rob Herring , Thierry Reding , linux-gpio@vger.kernel.org, Gregory Clement , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Subject: Re: [PATCH RFC 2/6] gpio: mvebu: honour EPROBE_DEFER for devm_clk_get() Message-ID: <20200329133400.GA25745@shell.armlinux.org.uk> References: <20200329104549.GX25745@shell.armlinux.org.uk> <20200329131659.4hbshjst4ccvje2n@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200329131659.4hbshjst4ccvje2n@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Sun, Mar 29, 2020 at 03:16:59PM +0200, Uwe Kleine-König wrote: > On Sun, Mar 29, 2020 at 11:48:09AM +0100, Russell King wrote: > > Honour deferred probing for devm_clk_get() so that we can get the clock > > for PWM. > > > > Signed-off-by: Russell King > > --- > > drivers/gpio/gpio-mvebu.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c > > index fa5641615db6..ee13b11c5298 100644 > > --- a/drivers/gpio/gpio-mvebu.c > > +++ b/drivers/gpio/gpio-mvebu.c > > @@ -1132,6 +1132,9 @@ static int mvebu_gpio_probe(struct platform_device *pdev) > > } > > > > mvchip->clk = devm_clk_get(&pdev->dev, NULL); > > + if (mvchip->clk == ERR_PTR(-EPROBE_DEFER)) > > + return -EPROBE_DEFER; > > + > > /* Not all SoCs require a clock.*/ > > if (!IS_ERR(mvchip->clk)) > > clk_prepare_enable(mvchip->clk); > > I'd say the following is the right thing to do here: > > mvchip->clk = devm_clk_get_optional(...); > if (IS_ERR(mvchip->clk)) > return ... It's not that simple. The clock is required for Armada 370, and is optional for Armada 8040. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up 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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 872F7C43331 for ; Sun, 29 Mar 2020 13:34:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 587D8206DB for ; Sun, 29 Mar 2020 13:34:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VEPQORb2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="03Bz54I1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 587D8206DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VT8MJAez6/3Qxcw+pDduio1Dc2fJb/tbS6AaXNDSCik=; b=VEPQORb2y06ovj uAd3Tzf3YiCiFQTrXqZWNE2mlnRycvZDfoI5DxP8JIwz4x+7VwoV0+8ILC1f9eN3ceuMFFmUOrByw euIF6vyuU30AnfdZpelSHRLjNoAwfyvLq0ykrIHos8pVxHrj+fJVkd+a9TUfnFQ40O7yHW1cGFU6h c+ozpF4/eBV5xRAVB4LlEHRhHohXnsDaevU3xv0XrOBy7O+4IoBHEMfOPMULIWotOpw4IuF+xNg+x VTUsrfYJu40HzCVE/3iMYGfcGQv37mIWbS1x+dvIxZfa3Zl/E/QWTyDWC3YWyKX8zu3YBpkYyv4vs JKb5EPzrLGORZXr6QSZQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jIY53-00073P-Ri; Sun, 29 Mar 2020 13:34:25 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jIY4z-00072v-JX for linux-arm-kernel@lists.infradead.org; Sun, 29 Mar 2020 13:34:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3C6tfF5Ul0fw3udMKyjvurS5QtWeo4pSfQAUnxBXyAY=; b=03Bz54I1bcN1+oZhNl0RWIA7u u3TIb2qtWRgALFddvdLJWDf7InsOpmxtRXdcZ1dwuIOpiPmx0j260PDH/if+o1UzW7tIxAnq13lFd fvhpP1mjLMojQk/HeUD9b3FSpxA0yPsfZLfv9b708+JMhVVmdbSzgGK9Tc2nUefUTxLNB5Ivf9rcs o1zpN4AvMfErLybwHlRByrvaZji4ZinfC+USvfYA86CCmw6UkYq44reUM/6Ur/OUzZ1fjs8nRtM8A 5wK3x/1Heaz/S9iArQvPpmrBi2r/viaaElG9n/3aHa8119Z74J/z2wHNtPNm9Cis+F/qsmzIBVZIT JhjFr68WQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:42932) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jIY4i-0005E4-F2; Sun, 29 Mar 2020 14:34:04 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jIY4e-0006FN-8B; Sun, 29 Mar 2020 14:34:00 +0100 Date: Sun, 29 Mar 2020 14:34:00 +0100 From: Russell King - ARM Linux admin To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH RFC 2/6] gpio: mvebu: honour EPROBE_DEFER for devm_clk_get() Message-ID: <20200329133400.GA25745@shell.armlinux.org.uk> References: <20200329104549.GX25745@shell.armlinux.org.uk> <20200329131659.4hbshjst4ccvje2n@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200329131659.4hbshjst4ccvje2n@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200329_063421_790196_C38E9B8A X-CRM114-Status: GOOD ( 16.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Andrew Lunn , Jason Cooper , linux-pwm@vger.kernel.org, Linus Walleij , Bartosz Golaszewski , devicetree@vger.kernel.org, Rob Herring , Thierry Reding , linux-gpio@vger.kernel.org, Gregory Clement , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Mar 29, 2020 at 03:16:59PM +0200, Uwe Kleine-K=F6nig wrote: > On Sun, Mar 29, 2020 at 11:48:09AM +0100, Russell King wrote: > > Honour deferred probing for devm_clk_get() so that we can get the clock > > for PWM. > > = > > Signed-off-by: Russell King > > --- > > drivers/gpio/gpio-mvebu.c | 3 +++ > > 1 file changed, 3 insertions(+) > > = > > diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c > > index fa5641615db6..ee13b11c5298 100644 > > --- a/drivers/gpio/gpio-mvebu.c > > +++ b/drivers/gpio/gpio-mvebu.c > > @@ -1132,6 +1132,9 @@ static int mvebu_gpio_probe(struct platform_devic= e *pdev) > > } > > = > > mvchip->clk =3D devm_clk_get(&pdev->dev, NULL); > > + if (mvchip->clk =3D=3D ERR_PTR(-EPROBE_DEFER)) > > + return -EPROBE_DEFER; > > + > > /* Not all SoCs require a clock.*/ > > if (!IS_ERR(mvchip->clk)) > > clk_prepare_enable(mvchip->clk); > = > I'd say the following is the right thing to do here: > = > mvchip->clk =3D devm_clk_get_optional(...); > if (IS_ERR(mvchip->clk)) > return ... It's not that simple. The clock is required for Armada 370, and is optional for Armada 8040. -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps = up _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel