From patchwork Tue Jan 16 10:36:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meghana Madhyastha X-Patchwork-Id: 10166437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE26C601E7 for ; Tue, 16 Jan 2018 10:37:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AAD32842D for ; Tue, 16 Jan 2018 10:37:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F51628462; Tue, 16 Jan 2018 10:37:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3333B2842D for ; Tue, 16 Jan 2018 10:37:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 642546E1DF; Tue, 16 Jan 2018 10:37:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 927A26E1DF for ; Tue, 16 Jan 2018 10:37:01 +0000 (UTC) Received: by mail-io0-x243.google.com with SMTP id t22so4109412ioa.7 for ; Tue, 16 Jan 2018 02:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yE68Cg1priBGvtuPyveBk//OOtQfXjteXsY89aUj/R0=; b=BSrFku1RVqwNALiuZB1yXjxLRvjiCVoGCTuS7TOPlxK3Cs+0eDoX+ILJqOByLWACUS TeeH4539rHyT2TgOuOCDSP3FkipCcEhffKorNdUmqBL8ggdbGQnB8EuomQnJF4u5YccA SceT+Wh3OU7eozqNzDbTA4jojrXX+UOeYwyx/wsNUALsbN39APgbHZSxLU25INI0j+kp HuYpv7oFU2AcoUCjtcpRlZmfjHTFHw8m/WZ5mQ38I4aj2CMFAtko0yf7whKS7AnqL403 nCOVNiveM/igmBneYQHFy/spS0k+Rp+f0l/ARmZ1LTeeuk5nPH7csu4VqdJGyht58IKp Goow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yE68Cg1priBGvtuPyveBk//OOtQfXjteXsY89aUj/R0=; b=hvJG24r4U+vwwtQKb3hiIzkRjuoTJQvn+MgLHjwfydrdMkKdBRGDVP2uHtT8SJr512 VMT0ShTW1K0MuUazPkV1H5z6R/Xhku5btCoa931iwa5n4s1meSJb0rCnASBV8ORzPSTK SPmlKiNp40xHAlIqLN0TpfwhVJlJO5/mVj5jUAxgH/cmeV9QjPge+P6tS7ic/YmMV3Xg /M3EwmkpZ7C86MKw2L194//PVTyGo2XdqckYTq1O8GfAQl8o+Vdl1ZVio+tq3+W4vdG5 XAjSlvOMxgLvF6+O0nNGHTEPuSZ1wL+xzszldOm/eqMpBskoRJVS9mMYM80T5I0X1DBR t96A== X-Gm-Message-State: AKwxytewLICqn7s4VPzxez7x80VuoTLqrmzoScR/xkDG8nZ7JeP+OSq1 AIsQ3ArEMW0nc5ozaX1V7Ww= X-Google-Smtp-Source: ACJfBosRdwLkWhc7OOXPyjhxqzvsRoTIl7WdkqUTxybi08q1UAj2EkyCgn/lZ/y/TlJtoaisj9qyCg== X-Received: by 10.107.114.16 with SMTP id n16mr37950629ioc.2.1516099020961; Tue, 16 Jan 2018 02:37:00 -0800 (PST) Received: from raspberrypi ([122.171.87.79]) by smtp.gmail.com with ESMTPSA id 28sm957301iot.20.2018.01.16.02.36.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jan 2018 02:37:00 -0800 (PST) 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-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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) {