From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754173AbbKBQbP (ORCPT ); Mon, 2 Nov 2015 11:31:15 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:46305 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337AbbKBQbA (ORCPT ); Mon, 2 Nov 2015 11:31:00 -0500 Message-ID: <1446481847.3442.61.camel@pengutronix.de> Subject: Re: [PATCH] pwm-backlight: Avoid backlight flicker when probed from DT From: Philipp Zabel To: Lee Jones Cc: Thierry Reding , Jingoo Han , Ajay Kumar , YH Huang , Christian Gmeiner , linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Date: Mon, 02 Nov 2015 17:30:47 +0100 In-Reply-To: <20151030182113.GH4058@x1> References: <1446133906-3076-1-git-send-email-p.zabel@pengutronix.de> <20151030182113.GH4058@x1> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:96de:80ff:fec2:9969 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lee, Am Freitag, den 30.10.2015, 18:21 +0000 schrieb Lee Jones: > > @@ -264,12 +266,32 @@ static int pwm_backlight_probe(struct platform_device *pdev) > > pb->enable_gpio = gpio_to_desc(data->enable_gpio); > > } > > > > + phandle = of_find_property(pdev->dev.of_node, "phandle", NULL) != NULL; > > This is a little ugly. > > If this is the only way to identify the probedness of a device then > you probably want to neaten it up a little. I suggest something along > the lines of: > > if (of_find_property(pdev->dev.of_node, "phandle", NULL)) > already_probed = true; > > Also, do you also want to check for "linux,phandle", as this is always > catered for in drivers/of/* Thanks for pointing this out. I suppose I should just check pdev->dev.of_node->phandle != 0 instead. That will already be initialized by unflatten_dt_node if either property was found. regards Philipp