From patchwork Wed Jan 14 13:51:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 5631581 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 829549F2ED for ; Wed, 14 Jan 2015 13:53:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A04B1200B4 for ; Wed, 14 Jan 2015 13:53:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAD8C20160 for ; Wed, 14 Jan 2015 13:53:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752989AbbANNwA (ORCPT ); Wed, 14 Jan 2015 08:52:00 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:38658 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbbANNv7 (ORCPT ); Wed, 14 Jan 2015 08:51:59 -0500 Received: from ayla.of.borg ([84.193.93.87]) by baptiste.telenet-ops.be with bizsmtp id fprw1p00e1t5w8s01prwut; Wed, 14 Jan 2015 14:51:57 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1YBOMW-000379-N2; Wed, 14 Jan 2015 14:51:56 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1YBOMa-0001dn-Iy; Wed, 14 Jan 2015 14:52:00 +0100 From: Geert Uytterhoeven To: Benjamin Herrenschmidt , Bryan Wu , Richard Purdie , Jingoo Han , Lee Jones Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , linux-fbdev@vger.kernel.org Subject: [PATCH 3/3] backlight: 88pm860x_bl: Use of_get_child_by_name() instead of refcount hack Date: Wed, 14 Jan 2015 14:51:59 +0100 Message-Id: <1421243519-6257-4-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421243519-6257-1-git-send-email-geert+renesas@glider.be> References: <1421243519-6257-1-git-send-email-geert+renesas@glider.be> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP of_find_node_by_name() calls of_node_put() on its "from" parameter. To counter this, pm860x_backlight_dt_init() calls of_node_get() first. Use of_get_child_by_name() instead to get rid of the refcount hack. Signed-off-by: Geert Uytterhoeven Cc: linux-fbdev@vger.kernel.org --- Compile-tested only --- drivers/video/backlight/88pm860x_bl.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index 9a23698b6fe8398c..2da5862876d1fe78 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c @@ -168,10 +168,7 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev, struct device_node *nproot, *np; int iset = 0; - nproot = of_node_get(pdev->dev.parent->of_node); - if (!nproot) - return -ENODEV; - nproot = of_find_node_by_name(nproot, "backlights"); + nproot = of_get_child_by_name(pdev->dev.parent->of_node, "backlights"); if (!nproot) { dev_err(&pdev->dev, "failed to find backlights node\n"); return -ENODEV;