Received: by 10.223.176.46 with SMTP id f43csp975608wra; Wed, 24 Jan 2018 08:42:20 -0800 (PST) X-Google-Smtp-Source: AH8x2278A6wfjuKPIUG/BpTO7N87KMnC52HA3gl9nrl79ew4LTeeZqcTK0knb/nVazyo6/7i3cfm X-Received: by 10.101.74.129 with SMTP id b1mr11486255pgu.317.1516812140447; Wed, 24 Jan 2018 08:42:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516812140; cv=none; d=google.com; s=arc-20160816; b=EupSDU34UH3vV61ifYzoR3DlVixL1tSZMKYl8EQg90cnywo+fKPb1V9NWFJ7vHWnYW LRiU7ErceoKAeB4DUlZaUFbnjtSBT0oX5i5jreMhq/qgldarUCOcdIoCbwwCVa9M3w4L cy3loh0ZS8AE4BYAyiTfYt6GhQVmQDP7JQy9Z4nWzp7pyfgKWqy3x+0NXhcQUpbZ9uZ4 3Bxr25dMk1iGVHHXzH0DFp3ox9w53OZ67JUqrrAD3Wn9V+7wNerIEb601D6OVwmKIWoc I8yOgkZVPZjXH6pkIzTTC4IBlETYTQt2AoFuI7lnFEIiA9HQLcNe5NytjO0WDUx9kW4g M8jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature:arc-authentication-results; bh=e4Rk7GlBUjKY8xH++S749NP9DnQbuEnrNBanlDSNFXw=; b=pkOtqDppVc/VXO5tGEz0DTdNhzvRLvlZj8aN4cCyTL44imHnzbxhUxkqjRBUUhsrfH C/6PHCykmwgx7Mx+axIlob82tjcD6DW70r+3CDIeRny1oBl0HVkgj6n9CsMG6A3lAy2P oBjTNaROe6QLCK6v5BC2d3bAqAm/z2LIWHY3y3nIRfHSp+go5VETdDTxJGcVMy+N7+mH MkZfIIapYKBsQg2znxlm3jGoNVYUGnPumZZjxMoFz6+7zNyW+N7A5+9YFoboLZMZA6z6 ccpwu1c6zZIKuXpwWuMxSV97Xv182jIVeNBMVRyx1BSHt/TZgjhkbzU0Btd9EPDNrCKg L0vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E0yWR3Gs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w31-v6si426509pla.402.2018.01.24.08.42.06; Wed, 24 Jan 2018 08:42:20 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E0yWR3Gs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964868AbeAXQlq (ORCPT + 99 others); Wed, 24 Jan 2018 11:41:46 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:44102 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934275AbeAXQlp (ORCPT ); Wed, 24 Jan 2018 11:41:45 -0500 Received: by mail-pg0-f66.google.com with SMTP id m20so3070593pgc.11 for ; Wed, 24 Jan 2018 08:41:45 -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=e4Rk7GlBUjKY8xH++S749NP9DnQbuEnrNBanlDSNFXw=; b=E0yWR3GsrxiOFVTKhgT8Wgr5qZ85s+xy/iXX3Brms49JHi8UR2CefLpRRZ3QvMfrRK 5lPlkwoAQgA54k6gUH7gHoFwGJwzFxYbENu924DOs0dAl/OZa+FoMVWDDnOTtwT5ATXr 4JQ+pK4uHpjGCrWJiMg9gD7+eGSaqE+CusNJ9ks8/6sb8vJOr+NKFfiWCroYoN3Sr/1U XU5Hm7lr3bKoLjWhB1Vc751We15m44RYAi9Ag+wa7z14dFGuJikSV9Twu0LsyEwtf7oq Ma1XIR0nQdMRbcOSWHsIx/vWiUv+rXT6Ps0PCERVaLX51QUaNEbe4eDjIZoSYvlmh2Iy VU6Q== 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=e4Rk7GlBUjKY8xH++S749NP9DnQbuEnrNBanlDSNFXw=; b=Vx9GPLMcqF0laPSaaG5pjh9HwHWx5mE4Tb+oXv1TDv9Fr4hMFOdzyUpv+acV5NEPI/ FjbtjLfs7v6O0jhu3/SEe4vVma14fdIbx5nz5pLGvi2HabwICmnnX889D7kaA8yt3rJ7 88/QqVmsgTOKW16/aSfHzhWSu6e9BDuWcI/YZosQ/OUeJ88vPNi+bJvln1v0cg4IhF/t cEsVhm6nZZ5zUxqLaoYyNjeYDQ/r2trDhFo/D7XxoVfrR3bvERMBvcXIeyYg6V7sVwG6 Plpv3W8Or6JO6e3F4m9M9Ylfp7QMaUFMn3Ti+Cz649Ivuu4LtExZz7/uU+FtxSnmkJ9N Z31w== X-Gm-Message-State: AKwxytcJwQHrC5YdjXNMAqVRYDNoxRKxUpbfS8TN+PH3HYG202eYv/+S EOslK7Yr+4mEnM+XmPk2grY= X-Received: by 10.101.77.140 with SMTP id p12mr11034316pgq.195.1516812104690; Wed, 24 Jan 2018 08:41:44 -0800 (PST) Received: from raspberrypi ([122.172.61.122]) by smtp.gmail.com with ESMTPSA id 62sm1139149pgh.80.2018.01.24.08.41.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 08:41:43 -0800 (PST) Date: Wed, 24 Jan 2018 16:41:38 +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 v19 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } -- 2.11.0