Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3076146imm; Sun, 1 Jul 2018 11:42:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJKDB1sLGcSKR3KWZmaOy0dJSYV+7HygccW9gBGny/PWYph89wcagyxoZ+O7PDaelve8gO8 X-Received: by 2002:a17:902:345:: with SMTP id 63-v6mr23265725pld.328.1530470527303; Sun, 01 Jul 2018 11:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530470527; cv=none; d=google.com; s=arc-20160816; b=F1XxDAs6ag2YS7Pbeu/PkHzr0d3q6adgsYf3f379vzdv/pDFQkgDgpEkJcr+aWcZ2c IlV89ahTQYinZMGM7BusH4h8igDNhjGz8JYCoD1C2d1mAoaR7DEvolv5v7ICUmOZQ60v Yw+cUMkTlXtR5B50ZcGFT59qDTMjPHhCM+pbUkJokQ8SINpagQGAqzzAm/dMhhDhyt5Q /Ld6rVHR6EhVoK87V7/PZnOjMGgAY5vQVIa6i74PKWgRoteX5g0FHYWLDJ1LAi+FL96c rCwz+5nYeBA52nCZ8q4en/lGSU+Dxn+2JMn7lALR0sI23yvQg9vSjQXqpIJt0gJlerLP r9fA== 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=UO/w0PZyLDA3H+y0CK3ussRxCwX9/gTjeAo+lsMzHRU=; b=FenP0W+RHtEawnVdjJyQYCpgQ4k/VEXo086xjxs9VjETKPIn5EZhiEcbhXOw3OrZII 2BqZOOcbu6CSyuK48zhVI/V+gTHmnqic36lC195r681A8eBsl4X0Z2cxmnTRuWUkRNsT 00FxQzF2GsPFkftlVesj2QEKWuOWTXLbzsqNRnwaTTgTqIFCb/PcKT7l3UCihrUTQ0u2 hdwdlDm4zakvbkEHFJ6iCVzaud4Il+Sr335CY3C48HnJ1gaQw1VsY470whG3ZYQIjW2v 5QetS/C/6SsUFVH6IJHaakCZP5jZ01YNef/jaExG0HLcL8rgfepcxrdJE4NXqm7yUH1W /ZdA== 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 g14-v6si14168354plo.95.2018.07.01.11.41.53; Sun, 01 Jul 2018 11:42:07 -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 S932917AbeGASkc (ORCPT + 99 others); Sun, 1 Jul 2018 14:40:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60332 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753068AbeGAQOS (ORCPT ); Sun, 1 Jul 2018 12:14:18 -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 8C7004A3; Sun, 1 Jul 2018 16:14:17 +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 3.18 76/85] backlight: tps65217_bl: Fix Device Tree node lookup Date: Sun, 1 Jul 2018 18:02:34 +0200 Message-Id: <20180701153125.397484606@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153122.365061142@linuxfoundation.org> References: <20180701153122.365061142@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 3.18-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);