Received: by 10.223.176.46 with SMTP id f43csp1150135wra; Wed, 24 Jan 2018 11:27:26 -0800 (PST) X-Google-Smtp-Source: AH8x226zKDO8rZ+LsvajCCnlaLR1NVyysIx3iA57V01tiMesOZDUS3lqNrcWpCG1P3uwQE7l1Jwd X-Received: by 10.101.100.69 with SMTP id s5mr11785387pgv.88.1516822046296; Wed, 24 Jan 2018 11:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516822046; cv=none; d=google.com; s=arc-20160816; b=U7T7LGq114zDMzeL5kHxq+tHS3k60Fu2oO+f8ZMkRs7ZUp7LYUB4v+yR7snCmW6otS 6J8UehDGMEsWKiylMB/yBFOK4vNnLL5knBp9/IsrumU+AQg6iZAeBj/6lndP5nPbvoIK OaMyMA6Gd+hFfZRPx1VTIFHmxdwTxWuagTLJ294iUnPSm4UYeGrRAGpz/BYToK+DfDG6 OaQn354wDxWKPgMbcESSbAd3zxM0G5F7Zwo0YErN3bofER2mO9LgB/lx0o9vpeOCbf1w rdqaSUPk+VBYzt0ySgCyw3rRuqA8hqu0Eb3fktzyfRwBsOgvT1D3/UvK0W4BGAX2eP3H 6zSQ== 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=RxoudRoRhtnRI+2E9uYsrb4Nb27LgH5EPwOvVdu454Y=; b=qLqwWISsKKYaAfAHGVQERndz+hQvVl5bFNNu64YnA6w4N9X3NLXdatQtWX2Yc+PK2w RhsGGt0P0ScXsMSvQ0vj6cEWzn2bFGOQSSuDv6lQkujo/S2H3ZR+6v+CX02dVGjd9gOl ilQy5USszdh558Px2QBOPCK5INTce7h5GizjbUU8sJ4zas+CkuYmXSGgX3IbxD6H7E9N KKFfKe1kHmjoSg/X5NJi920TanIbh+IfPsqcaEFCvlAunsvksfR21Pqn4ecsgkWmcbpA TH75nNptd/Wv4b+CCxGmvHC9YI4x7YBzpRbnCJHV3TSfHhoIfFClWiTf+4YloGuKDoAe Axfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eQ+yXV2h; 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 c1-v6si654082pli.241.2018.01.24.11.27.12; Wed, 24 Jan 2018 11:27:26 -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=eQ+yXV2h; 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 S1752590AbeAXT0x (ORCPT + 99 others); Wed, 24 Jan 2018 14:26:53 -0500 Received: from mail-yw0-f194.google.com ([209.85.161.194]:41861 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752422AbeAXT0t (ORCPT ); Wed, 24 Jan 2018 14:26:49 -0500 Received: by mail-yw0-f194.google.com with SMTP id b129so1915218ywa.8 for ; Wed, 24 Jan 2018 11:26:49 -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=RxoudRoRhtnRI+2E9uYsrb4Nb27LgH5EPwOvVdu454Y=; b=eQ+yXV2ha7e9alugQiNNrq4lbw2/oJcmSu7uTwW/VKei51y5Lc2dnJS/S9MltwM5nk 3CUKphmTf1YYhQGevm3jOXlBuWI82n/3aIxb9O3RAqFFdNldHjiZuQYl9E5Y8WuYDx2G d/oPh/JwPcVPfxGC6gLDs4ejRCaDcbM5uCHug= 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=RxoudRoRhtnRI+2E9uYsrb4Nb27LgH5EPwOvVdu454Y=; b=is2TTGIoZbRFFFAzLV0tVHS1Xfas9HSzZ68K5DGgzAERfqkzQPZSxJ87ze54HvkFp4 oHwXi8eo9jRK+ZKWDj8rlkU5SweIKddsbhkFFppzeHDlePsg9lL1McPG0dgutufJA6Vw F3M9KpIZAdHsjGrE2g9KtuhG4UGTzXLjdakqUWwobvnXrssjopteBTwjj8/D1Ytncxma a7R+mAQQS4QFiR+4iKmo+RoTa286MumfaHirAZgu6ZtUBvv+Ul/VXj4BxJDZ1kvYV6qZ gfL0aJxkHGzyowXmWNcuVS3yma1dFc0n+dONDstplMMHZfxrq+AKb+hAq9hQMSfMQkJf 7cOA== X-Gm-Message-State: AKwxytezaFDD6bl+DPjVaL00coMhiOb0bAHBTYni1WVz8Jd8P8dpRDUR N8pNfEYJ8zgBCf7f7OSH8O8+Ug== X-Received: by 10.13.242.68 with SMTP id b65mr716414ywf.399.1516822008959; Wed, 24 Jan 2018 11:26:48 -0800 (PST) Received: from localhost ([2620:0:1013:11:d3af:69ac:1964:28e8]) by smtp.gmail.com with ESMTPSA id f4sm397951ywa.99.2018.01.24.11.26.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 11:26:48 -0800 (PST) Date: Wed, 24 Jan 2018 14:26:48 -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: <20180124192648.onah24uylmskd7ul@art_vandelay> References: <20180124192346.g4k72pt2cfnj4763@art_vandelay> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180124192346.g4k72pt2cfnj4763@art_vandelay> 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 02:23:46PM -0500, Sean Paul wrote: > 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. > annnd I should spend more time reading the context of the code. Looks like backlight is optional here, so this is a valid code path. I'm sorry about that. So, Reviewed-by: Sean Paul I think every other patch has R-b, so if no one objects in the next day or so, I'll apply this to drm-misc-next Sean > 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 -- Sean Paul, Software Engineer, Google / Chromium OS