Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751744AbeAPKhD (ORCPT + 1 other); Tue, 16 Jan 2018 05:37:03 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:39014 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbeAPKhB (ORCPT ); Tue, 16 Jan 2018 05:37:01 -0500 X-Google-Smtp-Source: ACJfBosRdwLkWhc7OOXPyjhxqzvsRoTIl7WdkqUTxybi08q1UAj2EkyCgn/lZ/y/TlJtoaisj9qyCg== Date: Tue, 16 Jan 2018 10:36:54 +0000 From: Meghana Madhyastha To: Lee Jones , Daniel Thompson , Jingoo Han , Thierry Reding , Noralf =?iso-8859-1?Q?Tr=F8nnes?= , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v16 10/10] drm/omapdrm: Use of_find_backlight helper Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Replace of_find_backlight_by_node and of the code around it with of_find_backlight helper to avoid repetition of code. Signed-off-by: Meghana Madhyastha --- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c index 0803f64cb..4a5e707a1 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c @@ -186,14 +186,10 @@ static int panel_dpi_probe_of(struct platform_device *pdev) if (IS_ERR(ddata->vcc_supply)) return PTR_ERR(ddata->vcc_supply); - bl_node = of_parse_phandle(node, "backlight", 0); - if (bl_node) { - ddata->backlight = of_find_backlight_by_node(bl_node); - of_node_put(bl_node); + ddata->backlight = of_find_backlight(bl_node); - if (!ddata->backlight) - return -EPROBE_DEFER; - } + if (IS_ERR(ddata->backlight)) + return PTR_ERR(ddata->backlight); r = of_get_display_timing(node, "panel-timing", &timing); if (r) { -- 2.11.0