Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4421778pxb; Mon, 21 Feb 2022 21:05:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTLDYG4pYAK8ZY3QtRIhnqYklYi/i2RdMiIvab55/UoFC4SA06ayIIgD6Ds937s7dRto+6 X-Received: by 2002:a17:902:e984:b0:14f:e131:3476 with SMTP id f4-20020a170902e98400b0014fe1313476mr988800plb.146.1645506345420; Mon, 21 Feb 2022 21:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645506345; cv=none; d=google.com; s=arc-20160816; b=rCZy0no5dwcVGg3/kNKzAIRWKRgbLmolcIaj0x7b/EPhvePCVahAZdTJztX9/rU+Cm 9f7hekHGNUIaCMBz+bI4anpxCPZw/6+4gARH9uPs6YUtt/cJDnN9S1Lp5QY9ac3HI427 mr4pRe0dkYksiE2Iury/dLonOx01V0dHmpFlbONZvfibdu3uxsS1xhO+MrbV4vhRwpm4 o78cnBgacBFMhDVINf9s0bL5i3KcOCZZsdQVeCb5JdKf0D6wo/V4jp9bdeGVkyTX6Wde h1spV0oxe9esp07LaiXoVHXhc7bQQg+SujD7n4Dd1Oa+Yow2xraTkM3vLQgK2DWtZLB3 41TQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YJJWvS8WcC55/hXw1i5SriYk26S1p/f+PtGsHIvYMqw=; b=f4nCObFwdGsjc5DtbxP0q6Wp3smPaZQxaa90Y0260brXIjY5CBCbqXjajY0tjNtQVl 4iMeADxUXxt/i6Q3TgB130ehLucX6sh4MxAMDUKr7QdbDJTN5/bbEhPpWWNghh04r94d Z5Y15LW6q28pW//pCDoT4mMCrEZOpJ5vxqDXGyB27DF4Zc8HAuZAG7bYP6oBwlPuNpba 7oUbtjmxcBfVpsYjGceALxxCmCeSX0aVrN0eqGA2jkkcOSg4bO3R09MuQ1sAAK2u2VYD s7R3yqRZaLsjMk04uUG6WfnhrbHS86y2xq8TW+az/sGOeCtO7NPloAIKRXXRpmL38cQC HkwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=seGelVc2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id me9si1190090pjb.16.2022.02.21.21.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:05:45 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=seGelVc2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DBA06EA0; Mon, 21 Feb 2022 20:38:57 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349916AbiBUJND (ORCPT + 99 others); Mon, 21 Feb 2022 04:13:03 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347825AbiBUJI4 (ORCPT ); Mon, 21 Feb 2022 04:08:56 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 841EA24BE9; Mon, 21 Feb 2022 01:00:53 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2071E6112C; Mon, 21 Feb 2022 09:00:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 012B1C340E9; Mon, 21 Feb 2022 09:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434052; bh=Tp7Y9YHMOncNoiZZF7GWXAcQGmy39O0B35RFEcRctCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=seGelVc2Odd0XIf+l0B0MoYp9TNX5ECL14Wh07ZiP92FjAvGtUilCPrC6Uljspe/6 WzC7suJYKTPYvyaXC+FkPX2GQAaBjAoBt83eBLjgxqAZx6l69GTpOgdF+zRbA2QElK o3M33XQeZDVNZZaYw4ygJWzsqo6wH9uwrWXZmJr8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sascha Hauer , Heiko Stuebner , Sasha Levin Subject: [PATCH 5.4 76/80] drm/rockchip: dw_hdmi: Do not leave clock enabled in error case Date: Mon, 21 Feb 2022 09:49:56 +0100 Message-Id: <20220221084918.069503376@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sascha Hauer [ Upstream commit c0cfbb122275da1b726481de5a8cffeb24e6322b ] The driver returns an error when devm_phy_optional_get() fails leaving the previously enabled clock turned on. Change order and enable the clock only after the phy has been acquired. Signed-off-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220126145549.617165-3-s.hauer@pengutronix.de Signed-off-by: Sasha Levin --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 906891b03a38d..7805091bac32d 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -528,13 +528,6 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, return ret; } - ret = clk_prepare_enable(hdmi->vpll_clk); - if (ret) { - DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI vpll: %d\n", - ret); - return ret; - } - hdmi->phy = devm_phy_optional_get(dev, "hdmi"); if (IS_ERR(hdmi->phy)) { ret = PTR_ERR(hdmi->phy); @@ -543,6 +536,13 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, return ret; } + ret = clk_prepare_enable(hdmi->vpll_clk); + if (ret) { + DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI vpll: %d\n", + ret); + return ret; + } + drm_encoder_helper_add(encoder, &dw_hdmi_rockchip_encoder_helper_funcs); drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs, DRM_MODE_ENCODER_TMDS, NULL); -- 2.34.1