From patchwork Mon Nov 20 10:45:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10066293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A4EA60375 for ; Mon, 20 Nov 2017 10:47:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B6EE2022B for ; Mon, 20 Nov 2017 10:47:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4015929156; Mon, 20 Nov 2017 10:47:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A9622022B for ; Mon, 20 Nov 2017 10:47:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751277AbdKTKrE (ORCPT ); Mon, 20 Nov 2017 05:47:04 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36946 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751019AbdKTKp6 (ORCPT ); Mon, 20 Nov 2017 05:45:58 -0500 Received: by mail-lf0-f67.google.com with SMTP id y2so8605597lfj.4; Mon, 20 Nov 2017 02:45:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=dQJsqzy0QPJhWYhKnZgrGvhi7mHAzS1a8ouC1aXoAwY=; b=OczqXz/Kw+hhRz60d43M4afO9ixyBZij4qYnSP1NtDxfSgIAggRdzX77ED4COMEDmq tY7UxZXYQXh1fNC0QJ2c55H9TJgXCXewYcFARX0L285yhlvQXkyKmTRrntXhXCUtevpz BEY1l4YselErPgMFNEdMEdTPYJWkm85a9Aq3AEnzLsKdy/8TtazvBNpMLJBs2t9IIC/t 1fkPTXA+QDIlPUQHfZ133jxUgU+Dyy2zLc5jm4Blv8dYYUTqBWMBy/7Pbre08OcnyiLH kmSsjiLY51gagrvmNbYrGVyflm5z+qf8H49FMp/+gNkp+S3L2Kx93vb/MXzw8QDwNbhm QP9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=dQJsqzy0QPJhWYhKnZgrGvhi7mHAzS1a8ouC1aXoAwY=; b=mxvrge8tyVwKU5qfzhx2q//a/W5buKEdtorbkEKmpnMO2d+OomAdU7IXsy0RzNH5RH JCI1v0rXh7nl8ZRJlyi1O9NMQX1Nc1zFEBVkWcXtgKfy02V5gDYqsIwr4PIysHclGsOr Njh2UjpzvTnQi8thnzelG6By0jGrnHVjpwkJ9u5MWscztS3VUA9uwxyo5BHT8Jc5L+YC +YrCrW5lOs4Neyw17fndBJZBRSSsBZ2wuOgirlPCQleaaZSUaxa8iPsdnMrJtB98z40P GX6vwdM19pKzJExqBcT5f88dN9BU/DldkroyW838atRXa/mD8To/MxISR5i4/fg3jwtE WyBg== X-Gm-Message-State: AJaThX4PLfnVAZuqoIjqkSEvwv5CPwjmHMCp9Ty3giEv8Pyx+GHzsFRG EvwFz4G1s7ygJepkCwXfk6k= X-Google-Smtp-Source: AGs4zMbWrW3a47g3p5L5HRjIOK3Qbfg2bfMOTucz0/3ewOEmwNgWJ4Sg7yiYkQIKiGurZN7tpSVvyA== X-Received: by 10.46.46.3 with SMTP id u3mr4039127lju.117.1511174756582; Mon, 20 Nov 2017 02:45:56 -0800 (PST) Received: from xi.terra (c-c0bae655.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.230.186.192]) by smtp.gmail.com with ESMTPSA id t76sm1882113lff.84.2017.11.20.02.45.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 02:45:54 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.89) (envelope-from ) id 1eGjaK-0000hh-54; Mon, 20 Nov 2017 11:45:52 +0100 From: Johan Hovold To: Lee Jones Cc: Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable , Matthias Kaehlcke Subject: [PATCH v2 3/4] backlight: tps65217_bl: fix device-tree node lookup Date: Mon, 20 Nov 2017 11:45:46 +0100 Message-Id: <20171120104547.2639-4-johan@kernel.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171120104547.2639-1-johan@kernel.org> References: <20171120104547.2639-1-johan@kernel.org> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Fixes: eebfdc17cc6c ("backlight: Add TPS65217 WLED driver") Cc: stable # 3.7 Cc: Matthias Kaehlcke Signed-off-by: Johan Hovold Acked-by: Daniel Thompson --- drivers/video/backlight/tps65217_bl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c index 380917c86276..762e3feed097 100644 --- 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);