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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9FA58C433EF for ; Thu, 17 Feb 2022 13:37:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F29B010E2C7; Thu, 17 Feb 2022 13:37:32 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 92B9A10E2C7 for ; Thu, 17 Feb 2022 13:37:31 +0000 (UTC) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKgyP-00031E-SV; Thu, 17 Feb 2022 14:37:29 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1nKgyN-0000Wu-5O; Thu, 17 Feb 2022 14:37:27 +0100 Date: Thu, 17 Feb 2022 14:37:27 +0100 From: Sascha Hauer To: Dmitry Osipenko Subject: Re: [PATCH v6 02/23] drm/rockchip: dw_hdmi: rename vpll clock to reference clock Message-ID: <20220217133727.GQ18637@pengutronix.de> References: <20220217082954.2967889-1-s.hauer@pengutronix.de> <20220217082954.2967889-3-s.hauer@pengutronix.de> <0fa21d91-b15f-8049-d776-8c6e9e9334b2@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0fa21d91-b15f-8049-d776-8c6e9e9334b2@collabora.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 14:27:28 up 68 days, 22:13, 86 users, load average: 0.20, 0.15, 0.16 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Benjamin Gaignard , kernel@pengutronix.de, Sandy Huang , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, Michael Riesch , Peter Geis , Andy Yan , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Feb 17, 2022 at 04:20:15PM +0300, Dmitry Osipenko wrote: > 17.02.2022 11:29, Sascha Hauer пишет: > > + hdmi->ref_clk = devm_clk_get(hdmi->dev, "ref"); > > + if (PTR_ERR(hdmi->ref_clk) == -ENOENT) > > + hdmi->ref_clk = devm_clk_get(hdmi->dev, "vpll"); > > + > > + if (PTR_ERR(hdmi->ref_clk) == -ENOENT) { > > + hdmi->ref_clk = NULL; > > I missed in v5 that devm_clk_get_optional() could be used here. But this > doesn't worth the v7 by itself. I looked into it and came to the conclusion that I can't use devm_clk_get_optional for the "ref" clk because then I couldn't do the if (PTR_ERR(hdmi->ref_clk) == -ENOENT) part. Looking at it again I could do: hdmi->ref_clk = devm_clk_get_optional(hdmi->dev, "ref"); if (!hdmi->ref_clk)) hdmi->ref_clk = devm_clk_get_optional(hdmi->dev, "vpll"); I'll change that should I have to resend. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |