From patchwork Sat Jul 9 14:48:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12912244 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 2589BC43334 for ; Sat, 9 Jul 2022 14:48:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 520E110F67F; Sat, 9 Jul 2022 14:48:43 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9CEE910F678 for ; Sat, 9 Jul 2022 14:48:41 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id CDEDB845CA; Sat, 9 Jul 2022 16:48:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1657378119; bh=OLOPA1r8jMHgHpvhQWRIX0ItBqj7IZS0CFGe2FGJh2w=; h=From:To:Cc:Subject:Date:From; b=o1cCFu+6jSQnkGfPbQ67dSEkG7PYkmKb0uSetmp+OM5nEEHls+cBfVAEDYXlwOpOO Bql6M3GT8qHGOy+fiCa0MFfZBdhvdhoIk8UWL67rJBNycYKDjBDVgnJnwy6zP/r8Yt 7g7tbGG7ZLgvlKcKtKcQ5S8m2DrNO+0H6X0UHDU8fpYGh4vAItol4HAsQeznEI6aml RSjwuTmKRobbXE1PzG/V/n+mC3KEqPqgm7mCSDZq95SgX2COZR4hf9SaFx6GVREzmB ppVMQ/ayiG/X20ATU3Tzin/Hj4Azui29i9w2c9ZUXSb0zhuxPLrgikAFZe6kgmdzQ6 WRirDWVVWYyLg== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 1/4] drm/lcdif: Clean up headers Date: Sat, 9 Jul 2022 16:48:23 +0200 Message-Id: <20220709144826.9278-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Peng Fan , Martyn Welch , Liu Ying , robert.foss@linaro.org, Liu Ying , Alexander Stein , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drop unneeded headers, sort rest alphabetically, no functional change. Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner --- V2: Add RB from Liu V3: Add TB from Martyn from V1 --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 3 --- drivers/gpu/drm/mxsfb/lcdif_drv.h | 1 + drivers/gpu/drm/mxsfb/lcdif_kms.c | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index befad33dcb959..1370889c6d687 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -16,10 +15,8 @@ #include #include -#include #include #include -#include #include #include #include diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.h b/drivers/gpu/drm/mxsfb/lcdif_drv.h index cb916341e8454..6cdba6e20c02b 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.h +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.h @@ -8,6 +8,7 @@ #ifndef __LCDIF_DRV_H__ #define __LCDIF_DRV_H__ +#include #include #include #include diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 1bec1279c8b56..d7363e2b2fad0 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -17,9 +17,9 @@ #include #include #include -#include #include #include +#include #include #include #include From patchwork Sat Jul 9 14:48:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12912245 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 987F8C43334 for ; Sat, 9 Jul 2022 14:48:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 875D510F682; Sat, 9 Jul 2022 14:48:43 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9E00310F679 for ; Sat, 9 Jul 2022 14:48:41 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 4A541845D6; Sat, 9 Jul 2022 16:48:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1657378119; bh=/IwtqBsw26DxruMAnUOd4vy3gMTBSu42LYk9TJ12DxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LHZtfyjyIWO2YJl7N7y4yNxNsmalXa0KOKtAAUA39GUTKyLShb+TFvqOQN6jV+HPJ FN4CBUka7SA8rJcY3QLKKr/PquMbstCkjosppKjNOOROSpjrqqHpBxdbvGOArviOgV wobRo2x0hKtiIBbtkOmxYiP0yud9xxwa7NShEfUkiR1fE+tsn+tbHfUxQRoaQWC+vb VBzxGvkbGdj4MOwUIBAiuVs3i4Hy4oXMQ0sV4vtHbJpv0QHhroMFMNPbGx/wMJR9o4 k3jv2EvZ2QMG4GCKKmC+6tv5Qww8QKfPC/S8ZVg3lZK2IDf0VXHCl09GfvGkJGT+a8 Blx3QtQQjJi5Q== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 2/4] drm/lcdif: Consistently use plain timings Date: Sat, 9 Jul 2022 16:48:24 +0200 Message-Id: <20220709144826.9278-2-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220709144826.9278-1-marex@denx.de> References: <20220709144826.9278-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Peng Fan , Martyn Welch , Liu Ying , robert.foss@linaro.org, Liu Ying , Alexander Stein , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drop the crtc_ prefix from mode, consistently use the plain one. Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner --- V2: Add RB from Liu Replace plane with plain V3: Add TB from Martyn from V1 --- drivers/gpu/drm/mxsfb/lcdif_kms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index d7363e2b2fad0..829b0a6bb0d3f 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -123,8 +123,8 @@ static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags) writel(ctrl, lcdif->base + LCDC_V8_CTRL); - writel(DISP_SIZE_DELTA_Y(m->crtc_vdisplay) | - DISP_SIZE_DELTA_X(m->crtc_hdisplay), + writel(DISP_SIZE_DELTA_Y(m->vdisplay) | + DISP_SIZE_DELTA_X(m->hdisplay), lcdif->base + LCDC_V8_DISP_SIZE); writel(HSYN_PARA_BP_H(m->htotal - m->hsync_end) | @@ -139,8 +139,8 @@ static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags) VSYN_HSYN_WIDTH_PW_H(m->hsync_end - m->hsync_start), lcdif->base + LCDC_V8_VSYN_HSYN_WIDTH); - writel(CTRLDESCL0_1_HEIGHT(m->crtc_vdisplay) | - CTRLDESCL0_1_WIDTH(m->crtc_hdisplay), + writel(CTRLDESCL0_1_HEIGHT(m->vdisplay) | + CTRLDESCL0_1_WIDTH(m->hdisplay), lcdif->base + LCDC_V8_CTRLDESCL0_1); writel(CTRLDESCL0_3_PITCH(lcdif->crtc.primary->state->fb->pitches[0]), From patchwork Sat Jul 9 14:48:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12912243 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 8AA1CC433EF for ; Sat, 9 Jul 2022 14:48:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 337C010F679; Sat, 9 Jul 2022 14:48:43 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA16510F67F for ; Sat, 9 Jul 2022 14:48:41 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id B1C08845D9; Sat, 9 Jul 2022 16:48:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1657378120; bh=eRxAiov1tyHHVHQKg4SaG3M57lSjaFbycGfr0v9KPXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OKsBG1YkHRMoxZCHjlnr5tb3RSkXehXZudTBc+LdnEIv8BlxeDlMMM6e3VAAMOvnD zMMhY1ZiCZ8IAcK3rsYmazoic23aJLpr9MGxPUd9f0Q3JUFgZK1G9YXrbDSYBNdM57 4hNDpK2pPCTi7L4d/L9HGEeS5Ta7WK/N1v3zslASRyNz1fzB60BsWod6E84/Auyi4P 1dhVeQBRgDB09U9Djf01cjZhieXo/T83cH8TVysWoPhzlkM3bN+kYzogDlvN0dIFsR 5iDU3j7uAJXkHBxqCZKrP6+BPsz//0Rz45y+Zw87rxeWgbqcMP6ugFm8sszGYcrr1I IYb1FhIj0D8xQ== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 3/4] drm/lcdif: Clean up debug prints and comments Date: Sat, 9 Jul 2022 16:48:25 +0200 Message-Id: <20220709144826.9278-3-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220709144826.9278-1-marex@denx.de> References: <20220709144826.9278-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Peng Fan , Martyn Welch , Liu Ying , robert.foss@linaro.org, Liu Ying , Alexander Stein , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Update debug print to report bridge timings over connector ones. Drop missed comment commit from mxsfb. Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner --- V2: Add RB from Liu V3: Add TB from Martyn from V1 --- drivers/gpu/drm/mxsfb/lcdif_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 829b0a6bb0d3f..9a77c631300a4 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -204,7 +204,7 @@ static void lcdif_crtc_mode_set_nofb(struct lcdif_drm_private *lcdif, DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n", m->crtc_clock, (int)(clk_get_rate(lcdif->clk) / 1000)); - DRM_DEV_DEBUG_DRIVER(drm->dev, "Connector bus_flags: 0x%08X\n", + DRM_DEV_DEBUG_DRIVER(drm->dev, "Bridge bus_flags: 0x%08X\n", bus_flags); DRM_DEV_DEBUG_DRIVER(drm->dev, "Mode flags: 0x%08X\n", m->flags); @@ -296,7 +296,6 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc, lcdif_crtc_mode_set_nofb(lcdif, bridge_state, bus_format); - /* Write cur_buf as well to avoid an initial corrupt frame */ paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0); if (paddr) { writel(lower_32_bits(paddr), From patchwork Sat Jul 9 14:48:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12912246 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 922CCC433EF for ; Sat, 9 Jul 2022 14:48:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 14F2010F684; Sat, 9 Jul 2022 14:48:44 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB3E910F682 for ; Sat, 9 Jul 2022 14:48:41 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 1CDAA845E3; Sat, 9 Jul 2022 16:48:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1657378120; bh=0zrQ6GD2zG3NCklZYU8acqqFAbaDs7HNGn9HLBmlFD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EvwVDcC1Q/NTwT4sOhNx0yQwjjQ0F9w5LUS9Ql7Ve+4IISougWPAooe2DOCdDH+CP POmMg4ZVkTHQd3sZI+sOxHJD1hZU2CFL+ubc4RrnhvBZ86e+3htPX969Z/vhiO87XF 6X91JIg0wHtvqrZAMW/Kzzie7jCMExCKKpE31XYwEOWO+BiUOcudcUsUD0NEWv5Tfu VNQYIhWSv1kMrLNYMKX0zwZU8CqhWIO8OMDGFRbWLEpDCCjT29Y56ARW/qEwnv3ydj aCRQH47PdSxftYvbZwYULVnaMDZvkVDQSVj2gmxKSf38xA3JhZ0FLmf72wAQa+TXGn lwWqprmlPlo2A== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 4/4] drm/lcdif: switch to devm_drm_of_get_bridge Date: Sat, 9 Jul 2022 16:48:26 +0200 Message-Id: <20220709144826.9278-4-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220709144826.9278-1-marex@denx.de> References: <20220709144826.9278-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Peng Fan , Martyn Welch , Liu Ying , robert.foss@linaro.org, Liu Ying , Alexander Stein , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner --- V2: Add RB from Liu V3: Add TB from Martyn from V1 --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 1370889c6d687..746a4261f3da2 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -42,23 +42,11 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) { struct drm_device *drm = lcdif->drm; struct drm_bridge *bridge; - struct drm_panel *panel; int ret; - ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel, - &bridge); - if (ret) - return ret; - - if (panel) { - bridge = devm_drm_panel_bridge_add_typed(drm->dev, panel, - DRM_MODE_CONNECTOR_DPI); - if (IS_ERR(bridge)) - return PTR_ERR(bridge); - } - - if (!bridge) - return -ENODEV; + bridge = devm_drm_of_get_bridge(drm->dev, drm->dev->of_node, 0, 0); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); ret = drm_bridge_attach(&lcdif->encoder, bridge, NULL, 0); if (ret)