Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3056340imm; Sun, 1 Jul 2018 11:13:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK80oCEj3g7lYts3D9Wi5ebqXdcqwx3U8JNNbLeObHhWa5ZzZPAoVz/DRmvyE/PrAjKHPc9 X-Received: by 2002:a63:6243:: with SMTP id w64-v6mr19229947pgb.179.1530468781673; Sun, 01 Jul 2018 11:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530468781; cv=none; d=google.com; s=arc-20160816; b=lxyShpWbW5DOwyYTa3GqgT4CIcfpPd7dvnVzC+H27U/QG00coFKfCfkRKfaoIUJcny 6KAlTsPkrpRVYRvN/wbASkln3+YcDEuH+hcY3JNIoultdtHcsrgrFcCPtLCvyGxFnz9x cxexV+FE7DLr/LWVGLI/X112KhYY12K0gufpTscEH4wITby7qcugtADfjGkcbTMPOvlm KmZG6deVgo+HANnKYXiWqYrBcrIyOwrK0RQK7eLdz4liP+/PcPd5dBNPXigNqQzr/2It 8E3YAlrR11xsCY4F6wBWgAkpuNUlX+pxBnZydjBPLlA8TPdNm167ASTqf7PQ2hDhS+ly eevg== 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=iWLXZAewH5XKyQvOUvLxH/tLgNajuh07Inmjhy4WhQA=; b=wQhIigeGVwzSM/mAQpXoWn2qtksNw1vpr6s2aHOB6EQ58u6Gug6jY0IC36JBmO5Esh 7qzxh4Uq+NlY8DKSrUO3g6xKSjyNAQNr5NxVjSWodW5MKMEa5N34hJCAfYTucZnIlruP fNnP30fMr3Cn40ljY+QyIijjGGPyHRnNHobnN0cntgCZ3jFDp/Kh05qrjryDJrAkVvfe d28WZxddQiWcw2UNME9gtUpfNhi1E02gQAaXB7NOltXG75/FCls7ZWUDC6xPEqnC6MQ3 n2GLTPHUCdz4r2sOzDVBoVxHzqHjury0OQQa5JmXundNNtEuFJrY9I4DfCCAm8mDYpgb bkYA== 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 h4-v6si12108749pgp.490.2018.07.01.11.12.47; Sun, 01 Jul 2018 11:13:01 -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 S965547AbeGAQ1l (ORCPT + 99 others); Sun, 1 Jul 2018 12:27:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34134 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965529AbeGAQ1g (ORCPT ); Sun, 1 Jul 2018 12:27:36 -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 7BC8892B; Sun, 1 Jul 2018 16:27:35 +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.9 073/101] backlight: tps65217_bl: Fix Device Tree node lookup Date: Sun, 1 Jul 2018 18:21:59 +0200 Message-Id: <20180701160800.085774176@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@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.9-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);