Received: by 10.223.176.46 with SMTP id f43csp4401500wra; Tue, 23 Jan 2018 08:56:33 -0800 (PST) X-Google-Smtp-Source: AH8x2259ZuyKX9CYVZSCyfs+Ke2btM8CkTdEIN77AOY134rZ43hmag6dEqGztlQVdip9RrGGWjv7 X-Received: by 10.107.201.200 with SMTP id z191mr4476725iof.49.1516726593488; Tue, 23 Jan 2018 08:56:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516726593; cv=none; d=google.com; s=arc-20160816; b=eg7tNPv3EX+3hGs46OXybFFfFi20KGuI22rVGS5CIkAQKHwRzplKjBSGhAAaH3Xsfi Prpap2hpdEjOr1/+Ep1TMmfZRzxFIi1h4tgCNFkII1LQwPpTLZhscycEGOpjwAHApeDm MSsFcS/AjNiA9xjB/y3mUBfayYEY68g0XvnMJXc4gajeMxsqjcu0MtvdomNFHxpN5bIS NT52punog7vMJZwCCYJGGfxFeZTYtv4MMvcdJiEuR1zczqP1fSWgHLyAhyIgcaGxTk9Z ziictnDUpcoaWjEFZTPV6Lm+G2IB4XNPSUcM4t6hX8vVGIB+zmuzud1Pbr8KMMVYVWIR KarQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature :arc-authentication-results; bh=KtIWYZ081iMYJiIDQYI0YvLctNj+46K+MjFYxBwto2g=; b=DfRQlR4tdA9df66BAgua4emcWKz2EvRNs2zUJyTAJvtY24zpG3Ib8t6BDqcfM/NeQb nCFGs/DzH/h7DgHO65DkPs7OrjEw9AVoGdE0i2rbqFDaDXZl4gOaqqHRw7KR3bizizK0 S9M3vIDeAcWRthe4QWT1IcXlXij70q4cvaysxfmCjMAjSOFbajatLOINfpdjPqz8BNjm t0HQ7CAOYxgtjxAzYNP6GBOsLR6swWVSGht9LC37TTNPrxbGPJl32FQznvRyVFE0Tgup GqBwO9sQLkfV1+h5jwWfrBiO+rwwaLMpmxwbAWxx097INgU5cbqyDHzlWSwMg4JT2omf 8M5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o0uzFf4Z; 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 98si15742074iok.197.2018.01.23.08.56.19; Tue, 23 Jan 2018 08:56:33 -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=o0uzFf4Z; 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 S1751963AbeAWQzO (ORCPT + 99 others); Tue, 23 Jan 2018 11:55:14 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:43495 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751799AbeAWQzM (ORCPT ); Tue, 23 Jan 2018 11:55:12 -0500 Received: by mail-pf0-f193.google.com with SMTP id y26so759437pfi.10 for ; Tue, 23 Jan 2018 08:55:12 -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:content-transfer-encoding:in-reply-to :user-agent; bh=KtIWYZ081iMYJiIDQYI0YvLctNj+46K+MjFYxBwto2g=; b=o0uzFf4ZgjkjKUXZD48dmSgzML9wv2Aysts9ls0dxrfHcHFY6FupVgwekEqFpCX2lz jLro9cXcln9HD3Pn2kfp555XVo0UOcMVq6m6Ll5TkcPiO5DeBKHmRpVzjRQxkWaXyDLe y2rs3SYjq+fk2leYHGo2AaaZpMzAfa8L3Qr6z36eNdETlNuVJsQbLFe3hJtqgiU49Sha OJxvpHrTrmbcDLhLyGyKE/D2BtRnq+vAk9eb5QZqHcyr6d6+0/C1MDqiMimP+cFn1JoR D6CMzJibsxEEMr9C2GGzJUhORu+H2BwKB6FCLQ2bboJdtfbRze3jIUWcoXR2O1CbQWCm Psyg== 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:content-transfer-encoding :in-reply-to:user-agent; bh=KtIWYZ081iMYJiIDQYI0YvLctNj+46K+MjFYxBwto2g=; b=raN1nT/uSj3JG5Inz2SSm0Uj1iyX7x2L14nf9076z5Or6PWQnkJwo/XwKj7UTswx3l +uL71pLstTOiyeKbDM7ccCDsxy5gHZStVPWd6IvrflLoV93eKCWl8NFxcUP1dLeMLV1M UCokan4SmxKmIa4nygcf+kaN5J2QrENfESvrNRlcascST5QKSk7oNVT5V3qIBOXEOAH4 DXmukwoaCaF/4btK4x+Tg5RMVySnJwk4NjW4D+GXdowTXqLFbyQYF8wYjelZEzpM8Up7 fCOt9CtL4ivolozYci5mAiKMzkDsdL55kJGp2NQKLSFn+2bmViTXV4s5EPb/a1W41cKM CHvQ== X-Gm-Message-State: AKwxytc+qbL52v48Aq5MmWRWAFHbynMZOoTDwKFydJ2H94EtwVGTHe0/ NJQgrrT6gOw7mWSK6ysQfzc= X-Received: by 2002:a17:902:ab8f:: with SMTP id f15-v6mr5967873plr.214.1516726512305; Tue, 23 Jan 2018 08:55:12 -0800 (PST) Received: from meghana-HP-Pavilion-Notebook ([122.171.92.137]) by smtp.gmail.com with ESMTPSA id w63sm7826340pfa.173.2018.01.23.08.55.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2018 08:55:11 -0800 (PST) Date: Tue, 23 Jan 2018 22:25:01 +0530 From: Meghana Madhyastha To: Noralf =?iso-8859-1?Q?Tr=F8nnes?= , Lee Jones , Daniel Thompson , Jingoo Han , Thierry Reding , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v18 10/10] drm/omapdrm: Use of_find_backlight helper Message-ID: <20180123165501.GA5908@meghana-HP-Pavilion-Notebook> References: <69379bffdebdddf49952eabeaaee7f1dd7cff99c.1516632388.git.meghana.madhyastha@gmail.com> <394a73f6-3459-449f-6d9f-4cb52a1d3328@tronnes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <394a73f6-3459-449f-6d9f-4cb52a1d3328@tronnes.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 23, 2018 at 03:37:38PM +0100, Noralf Tr?nnes wrote: > > Den 22.01.2018 15.56, 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 > >--- > >Changes in v18: > >-Fixed warnings resulting from passing device_node* to of_find_backlight. > > Fixed it by passing struct device* to of_find_backlight > > > > drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 33 ++++++++++------------------ > > 1 file changed, 11 insertions(+), 22 deletions(-) > > > >diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c > >index ac9596251..93b7a176d 100644 > >--- a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c > >+++ b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c > >@@ -156,14 +156,14 @@ static struct omap_dss_driver panel_dpi_ops = { > > static int panel_dpi_probe_of(struct platform_device *pdev) > > { > > struct panel_drv_data *ddata = platform_get_drvdata(pdev); > >+ struct device *dev = &pdev->dev; > > struct device_node *node = pdev->dev.of_node; > >- struct device_node *bl_node; > > struct omap_dss_device *in; > > int r; > > struct display_timing timing; > > struct gpio_desc *gpio; > >- gpio = devm_gpiod_get_optional(&pdev->dev, "enable", GPIOD_OUT_LOW); > >+ gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW); > > Please don't make unrelated changes like this. It clutters the patch. > You can just as well use &pdev->dev when getting the backlight also. I had made the change in order to be more consistent with how the other drivers were doing this. Most of them had a variable struct device *dev. However, I can undo this if necessary. > > if (IS_ERR(gpio)) > > return PTR_ERR(gpio); > >@@ -175,47 +175,36 @@ static int panel_dpi_probe_of(struct platform_device *pdev) > > * timing and order relative to the enable gpio. So for now it's just > > * ensured that the reset line isn't active. > > */ > >- gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); > >+ gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); > > if (IS_ERR(gpio)) > > return PTR_ERR(gpio); > >- ddata->vcc_supply = devm_regulator_get(&pdev->dev, "vcc"); > >+ ddata->vcc_supply = devm_regulator_get(dev, "vcc"); > > 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(dev); > > Any reason you don't use the devm_ version here? > You do remove error_free_backlight... > > With the devm_ version remember to drop the put_device in > panel_dpi_remove(). > > Noralf. > > >- 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; > >+ dev_err(dev, "failed to get video timing\n"); > >+ return r; > > } > > videomode_from_timing(&timing, &ddata->vm); > > 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; > >+ dev_err(dev, "failed to find video source\n"); > >+ 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) >