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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 479F1C77B73 for ; Mon, 22 May 2023 21:48:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1C445847B0; Mon, 22 May 2023 23:47:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=xff.cz header.i=@xff.cz header.b="dMswvKDx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2CA0C84791; Mon, 22 May 2023 23:47:29 +0200 (CEST) Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 81E7F847D9 for ; Mon, 22 May 2023 23:47:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=megi@xff.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1684792043; bh=nYrKMDnHG/FL6H+woXr5MYMJf9kiEqFX2b/hS8EBBHM=; h=From:To:Cc:Subject:Date:References:From; b=dMswvKDxX8bUHTzsFogvFDAtS9VyQg0DaQOGUSG6+aJ/j+f76PQkUwQP39k/2/b/O eaVOZo3HXrRKAa5FEELLKkIuVjAL5bzmGq6uxrWBEj9mtRE72SHPkLDiHVX6sX1CBy oyikfnnyeCeovjqhqQ4TD0JgnzH7c1Rb7r8C0P1c= From: megi@xff.cz To: u-boot@lists.denx.de Cc: Ondrej Jirman , Anatolij Gustschin , Simon Glass , Philipp Tomsich , Kever Yang , Chris Morgan Subject: [PATCH 3/8] video: rockchip: dw_mipi_dsi: Fix external phy existnece check Date: Mon, 22 May 2023 23:47:03 +0200 Message-Id: <20230522214708.3886796-4-megi@xff.cz> In-Reply-To: <20230522214708.3886796-1-megi@xff.cz> References: <20230522214708.3886796-1-megi@xff.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Ondrej Jirman &priv->phy is always true. Compiler warns about this loudly. Use a propper check for phy device allocation. Without this fix using this driver with SoC that doesn't use external phy (eg. RK3399) doesn't work. Signed-off-by: Ondrej Jirman --- drivers/video/rockchip/dw_mipi_dsi_rockchip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/rockchip/dw_mipi_dsi_rockchip.c b/drivers/video/rockchip/dw_mipi_dsi_rockchip.c index ca548a60b750..b1b5328595e0 100644 --- a/drivers/video/rockchip/dw_mipi_dsi_rockchip.c +++ b/drivers/video/rockchip/dw_mipi_dsi_rockchip.c @@ -344,7 +344,7 @@ static int dsi_phy_init(void *priv_data) struct dw_rockchip_dsi_priv *dsi = dev_get_priv(dev); int ret, i, vco; - if (&dsi->phy) { + if (dsi->phy.dev) { ret = generic_phy_configure(&dsi->phy, &dsi->phy_opts); if (ret) { dev_err(dsi->dsi_host, @@ -527,7 +527,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, struct display_timing *timings, } /* for external phy only the mipi_dphy_config is necessary */ - if (&dsi->phy) { + if (dsi->phy.dev) { phy_mipi_dphy_get_default_config(timings->pixelclock.typ * 10 / 8, bpp, lanes, &dsi->phy_opts); @@ -827,7 +827,7 @@ static int dw_mipi_dsi_rockchip_probe(struct udevice *dev) } /* Get a ref clock only if not using an external phy. */ - if (&priv->phy) { + if (priv->phy.dev) { dev_dbg(dev, "setting priv->ref to NULL\n"); priv->ref = NULL; -- 2.40.1