Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3000094imm; Sun, 1 Jul 2018 10:02:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdCKewm7/0P4ZCq9Hm+orJoQx0P3+DKwDHSrC+1l8z9X1T2YzpXA6QAJadzcjcbPLeKHtbF X-Received: by 2002:a63:1262:: with SMTP id 34-v6mr15778091pgs.154.1530464554502; Sun, 01 Jul 2018 10:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530464554; cv=none; d=google.com; s=arc-20160816; b=iDkDiXOuCjuycFVixMH6/fGA7T1M1uj+ZloxUJuR6byM/K38TuPyuEZ3vATc6LOe5x yv5BUR1vlkP8uZuW9Urje3hC3e+Gqr8fQxyhCOcxCmSVSWrqjPsYTBsqBNjGVsq66KF9 C3v+8VFpYhre3Vni2FmV80dkW0xdTFTvFVcc0m3Zdaw7arvek1k55AdSuk0gbtxfCor9 GojzMmaOAyKov/d8gis73w18bWZteRLRplmJVXN8R8V3pyxw68DEZ97As7J92H/KIedL LaN/p2NF85CBhnvV8ezzSlYIRcRmm85WLG1U9JwhqwuiXkGXbfQmmnjdBW1H9hmJjxgh cc9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=kNZsuAZh45VEr97tSwoCkXZrJGRWTYtOe8f8Q6X+Dxo=; b=PzoD7UIuWjUSdVL61kKRUXrpDSwiKzNkNjUCy/sxR6SVKuEJcUAL/7Ofn0/Vu1o6Hc DSwp/O541qCff0xBQ6zYFZ6quxEvOCPu/UfgGBe6HzA8LcnJgIKHna5sUowYeB5VnLT1 51981T4Y1bXyRaZA7p/kZBED2FAHFGhjzy7ZPdDpDm/Yiqi9FhGzLS16VBt8kZkxrUPW hqsf0kd34o3R+WMSYpzB1uSX43Cp63xwzxU2btEr7fw030Qcykr3m2PGQUtzBD+pjM9q piDzB2UuVxNpd7zRAvEXVE5Hp/TvUzhKGa1RI9ZLhofFnzs9CTQG2J/sOeXkr0+O09qp GNBA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4-v6si14060112plp.219.2018.07.01.10.02.19; Sun, 01 Jul 2018 10:02:34 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934120AbeGARAe (ORCPT + 99 others); Sun, 1 Jul 2018 13:00:34 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37892 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032387AbeGAQnn (ORCPT ); Sun, 1 Jul 2018 12:43:43 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A876CACD; Sun, 1 Jul 2018 16:43:42 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Daniel Thompson , Lee Jones Subject: [PATCH 4.17 157/220] backlight: tps65217_bl: Fix Device Tree node lookup Date: Sun, 1 Jul 2018 18:23:01 +0200 Message-Id: <20180701160914.842386621@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 2b12dfa124dbadf391cb9a616aaa6b056823bf75 upstream. Fix child-node lookup during probe, which ended up searching the whole device tree depth-first starting at the parent rather than just matching on its children. This would only cause trouble if the child node is missing while there is an unrelated node named "backlight" elsewhere in the tree. Cc: stable # 3.7 Fixes: eebfdc17cc6c ("backlight: Add TPS65217 WLED driver") Signed-off-by: Johan Hovold Acked-by: Daniel Thompson Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman --- drivers/video/backlight/tps65217_bl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/video/backlight/tps65217_bl.c +++ b/drivers/video/backlight/tps65217_bl.c @@ -184,11 +184,11 @@ static struct tps65217_bl_pdata * tps65217_bl_parse_dt(struct platform_device *pdev) { struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); - struct device_node *node = of_node_get(tps->dev->of_node); + struct device_node *node; struct tps65217_bl_pdata *pdata, *err; u32 val; - node = of_find_node_by_name(node, "backlight"); + node = of_get_child_by_name(tps->dev->of_node, "backlight"); if (!node) return ERR_PTR(-ENODEV);