Received: by 10.223.176.46 with SMTP id f43csp1147516wra; Wed, 24 Jan 2018 11:24:33 -0800 (PST) X-Google-Smtp-Source: AH8x225mN0UDuMFNAbky41ESZZ8QGaBcSeHxc5h73Fb7ZmS4SGgi1ETZv6dirC7yBYYrmvJfQNFq X-Received: by 2002:a17:902:34e:: with SMTP id 72-v6mr9225942pld.126.1516821873166; Wed, 24 Jan 2018 11:24:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516821873; cv=none; d=google.com; s=arc-20160816; b=DyX9VTdRXWGRNOjfY0oR6qLhuBKL/V3UQd+ltQ9HftEZoJXjkmwLH37TwijdIZuwXo gW0dBgZfWj3WQakHohb6Bxag8ETZUoLh3Uo0JkHDEcwJb9vuKt0+sDcahhU4GEZQ1S7X 4zetTkDxS1wWLmL31I5I5CSxIjfztEBDV41NpKSCnsatBFup4hkUUdV+dWMXEX/mRbQY b/i41/xMdSXQpv623eCQkGZgH0UYymMjpkF4dtWQYBi1IVZGmzDxPqPmODNzP1Y9V37Q ynau20jMBaRGAJ6d8WWKDT82Qef9PU8w0EPxJf7wUriEh9seEKCrDua1lMLweCdNbBAC XhYA== 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:cc :to:from:date:dkim-signature:arc-authentication-results; bh=zaQf673W4QIoHbgoOO4LTlylPuCkLer2vfFDqaJZiJQ=; b=zMvgk3g+oel7pVgO06tG3jigcUzorJTw4NjpQFz3adNFMoToAJVTpllXIyHbjZLGJS E34ndBoIRbpAufKwjXEfkyn5pi9RTi3dTt/WhK0pnF24ehLUe67JUgh9lffWorMVLF6c XR4C/fs7UY+5w6+LznEtFOwdlIgPvxRA75hNSddVDdtAXeczcPlO4CZRLksp55Y0K0ex o9hAls2Zra036hmSCelI2Ize6W14JVQ+begOM5yMkr1fvPQF1Qn1s3cmJReFZPUE2oTo tIBytwk4WnXqYRloZMWhE0fByx8qr7cJIaFYRpPYbYD1hiZ0CMTfiaicYyk2joRJ/hn5 vvjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JNCXTpR4; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7-v6si609939plz.613.2018.01.24.11.24.19; Wed, 24 Jan 2018 11:24: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=@chromium.org header.s=google header.b=JNCXTpR4; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752439AbeAXTXt (ORCPT + 99 others); Wed, 24 Jan 2018 14:23:49 -0500 Received: from mail-yb0-f196.google.com ([209.85.213.196]:42065 "EHLO mail-yb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbeAXTXr (ORCPT ); Wed, 24 Jan 2018 14:23:47 -0500 Received: by mail-yb0-f196.google.com with SMTP id i13so1976511ybl.9 for ; Wed, 24 Jan 2018 11:23:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zaQf673W4QIoHbgoOO4LTlylPuCkLer2vfFDqaJZiJQ=; b=JNCXTpR4ZBOVvWjMdBmY9tKaXlLJZbYZX+h/1FtytF+Aem+0P51rg8S+5slAN6OryX GTHBKvaGAWcpniyI8cPeOR6e8F224RuHY1GyHiivrAMtMl4CPQYmOQk3jjCCc7MV76Ar hSx9R4Ih1i51n6TTeEhqKxTJt9OvndeJqEbsw= 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:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zaQf673W4QIoHbgoOO4LTlylPuCkLer2vfFDqaJZiJQ=; b=q3hMpb7WAZ0cjTcPmaK85XNIS0U/i1yy0oCBQlslQa0sELpYp0fQoQlS23Hw1J4Arg XtVp/emMmi2hHX9B0e/fi7B0j3+m5ZlaEIuyeqYWHxa0d6bLKa3y4ETkhT430FFSPqF2 rEoglRXC6B73lLF6g1vqidOiATmdU1wVBTm7MB7ydet+bLvwvhWLWl2cNb0/Ar7K5QQG TkcQhw5/NkAyYK//Ee3+lDUGo/pBTeH/tnziD+N1hPR6WW1ID7xiI4FDhKCJb3QqqPK/ 0qkuvKy1JyPNhjXbnoliJbddqCq/LIyUeR943pIDLYUVr092O5KR7HzCsvho5RRvEe7K hmCQ== X-Gm-Message-State: AKwxyte53GhcmJmGE+y60u+RriImJBUkL84ju/HnKG7foruhi4zXlhZR u5ReXyTYaOX58BWx0KqpAtUZu0KWLGw= X-Received: by 10.37.250.25 with SMTP id b25mr6227341ybe.218.1516821826954; Wed, 24 Jan 2018 11:23:46 -0800 (PST) Received: from localhost ([2620:0:1013:11:d3af:69ac:1964:28e8]) by smtp.gmail.com with ESMTPSA id z136sm398976ywz.93.2018.01.24.11.23.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 11:23:46 -0800 (PST) Date: Wed, 24 Jan 2018 14:23:46 -0500 From: Sean Paul To: Meghana Madhyastha Cc: 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: Re: [PATCH v19 10/10] drm/omapdrm: Use of_find_backlight helper Message-ID: <20180124192346.g4k72pt2cfnj4763@art_vandelay> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 24, 2018 at 04:41:38PM +0000, Meghana Madhyastha wrote: > 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)) AFAICT, devm_of_find_backlight can return NULL. As such, you should be checking IS_ERR_OR_NULL here instead of just IS_ERR. Looks like you also made this same mistake in other patches in the series, so please fix those up as well. Sean > + 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 > -- Sean Paul, Software Engineer, Google / Chromium OS