Received: by 10.223.176.46 with SMTP id f43csp1195302wra; Wed, 24 Jan 2018 12:14:13 -0800 (PST) X-Google-Smtp-Source: AH8x225iADRjod4cUXg96vTnpsI/r/1KJAU1AKUwtyW7/ww8tfmA7+kvv0qVRVCASe3eXFCOAxIr X-Received: by 2002:a17:902:901:: with SMTP id 1-v6mr3159628plm.165.1516824853055; Wed, 24 Jan 2018 12:14:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516824853; cv=none; d=google.com; s=arc-20160816; b=QEYVB382c87XpEKtDa9K/SZ3YkvD/gm3w76sG9YWsLt6QqPxASOysR1x5YFLGiWzP9 7AKP7vc3D7kMvu6hJDx/+Tt23ubjhJGh2FRtyalZypA2sKQb5hZ1jRRRX0c/hdvmUKre PitHjrJ5vCXUtV7VqUyT+fAQhBviC7MbBPy5ESGq+SMjsAJCqXQwoH/S7BZaK7bz4hkn BF42qL02vB1KnKuOMIBktBMqmQvKMzC7rvh1Spk7YMNtYdBwYxSzcKt4u74Fk7pS5QiC nGY3EC9f4Q0JqBmL/5IRR7KyCfNJxOaVThrBalv6QbTLbyQr3tks0LAfrXqox1tQfRqH iLaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=VieXZhw8EBFHaZ9FuGCqPLLbwJWNIciwImAOaQa4FVc=; b=Z1my8Fi2r2t8K7xPn61oe2LYbzmAnWobS70PDALJa6UqBWtqXX/ti2UVJTy+6sge+8 KgV7cCFWAvU7liAwKbHgGppUoT1xgp0qUcRKbyqdVFO16NL3uEIePgKxvgAh9XSY6gk9 YnPTtvTmYB8tTG/xKCvv0dewNZbhhOLS61LAjPcXxB9AojSxIJqbY0Sc+Y3TNrgrQ2DH XwVQ3Dxa9VexKRbYxDCgg4i5W+cU+itK1RTqvCVgS8k3sI5A6qSNNECfzniSPXTLiGVh 7l0buTxcvW+CR8PTuyj7MntlqtMK5WvFR6IWbQNvPvGRfB8rjXjSZ8f/4TS5S4r+cvNc WA+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 93-v6si676899plc.515.2018.01.24.12.13.57; Wed, 24 Jan 2018 12:14:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932238AbeAXUNc (ORCPT + 99 others); Wed, 24 Jan 2018 15:13:32 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:35388 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932099AbeAXUNb (ORCPT ); Wed, 24 Jan 2018 15:13:31 -0500 Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:52789 helo=[192.168.10.157]) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eeRQH-0003Go-Jl; Wed, 24 Jan 2018 21:13:29 +0100 Subject: Re: [PATCH v19 10/10] drm/omapdrm: Use of_find_backlight helper To: Meghana Madhyastha , Lee Jones , Daniel Thompson , Jingoo Han , Thierry Reding , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= Message-ID: <78387dfc-02c5-476b-1492-adbeaaeb75f7@tronnes.org> Date: Wed, 24 Jan 2018 21:13:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Den 24.01.2018 17.41, skrev Meghana Madhyastha: > 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 > --- Reviewed-by: Noralf Trønnes > Changes in v19: > -Changed to devm version of of_find_backlight in omapdrm (patch 10) > -removed assigning pdev->dev to variable dev in omapdrm (patch 10) > > drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 25 +++++-------------------- > 1 file changed, 5 insertions(+), 20 deletions(-) > > diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c > index ac9596251..b4a4006a2 100644 > --- a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c > +++ b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c > @@ -157,7 +157,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev) > { > struct panel_drv_data *ddata = platform_get_drvdata(pdev); > struct device_node *node = pdev->dev.of_node; > - struct device_node *bl_node; > struct omap_dss_device *in; > int r; > struct display_timing timing; > @@ -183,19 +182,15 @@ 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 = devm_of_find_backlight(&pdev->dev); > > - 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) { > dev_err(&pdev->dev, "failed to get video timing\n"); > - goto error_free_backlight; > + return r; > } > > videomode_from_timing(&timing, &ddata->vm); > @@ -203,19 +198,12 @@ static int panel_dpi_probe_of(struct platform_device *pdev) > in = omapdss_of_find_source_for_first_ep(node); > if (IS_ERR(in)) { > dev_err(&pdev->dev, "failed to find video source\n"); > - r = PTR_ERR(in); > - goto error_free_backlight; > + return PTR_ERR(in); > } > > ddata->in = in; > > return 0; > - > -error_free_backlight: > - if (ddata->backlight) > - put_device(&ddata->backlight->dev); > - > - return r; > } > > static int panel_dpi_probe(struct platform_device *pdev) > @@ -270,9 +258,6 @@ static int __exit panel_dpi_remove(struct platform_device *pdev) > > omap_dss_put_device(in); > > - if (ddata->backlight) > - put_device(&ddata->backlight->dev); > - > return 0; > } >