From patchwork Mon Nov 13 10:20:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10055505 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 CF6156029B for ; Mon, 13 Nov 2017 10:21:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 914342934F for ; Mon, 13 Nov 2017 10:21:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85F4029361; Mon, 13 Nov 2017 10:21:20 +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 103042934F for ; Mon, 13 Nov 2017 10:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751759AbdKMKUy (ORCPT ); Mon, 13 Nov 2017 05:20:54 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:54368 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbdKMKUv (ORCPT ); Mon, 13 Nov 2017 05:20:51 -0500 Received: by mail-lf0-f67.google.com with SMTP id a2so17683053lfh.11; Mon, 13 Nov 2017 02:20:50 -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=GGVgT+bFtUPX8Qdwx/mw4x1Of08Xvauu2t45wgihUlosTtouFNzEJREGdBc/f2Zd+Y XBRjCnVGIujYBO+0L+4G0M6CuSXbjfLlUxIfOgw+L2ZY0TrohhYfwbXpbbQb/Z8bRTZ/ 5VDYAruRNlZ2FGjkxTbYWKyefW7D3cLtyKapQHmlKJrEoxhd/SdfJddhylSsXIY/vKqD hrYQyXqFSClN/yIFqBcQ2hy/iLJQOJJFIDD7sWpiCiHF+jaGoFru34dTNT8rTTapqs3v No4AjDmsdlenzZEf1UqHKiGlx8hScQV2/JjaidDmNyt8KSp8SHXiBljjtLdFxvpi0YxO /PrA== 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=VBXHZg3q+Yv07zA5m4h1HdUcVt+HOzlclG9QjHAuvm535TrQHDLSq32fzGoKbk1eCh IcTPLGdjmxoVgMLz5x9XIyKDAIfv8NgvtYUxKcAsvZJyFXHOxy9sWPaf7yxFQrEGssHi /hFt/BBCoRHDuDEluLQwxsrUAbJEmq5RPDMsAuyIxzrFOPgQciv96mth6eXAjgUeO8bR oruKMHv4k3bNgiHBUZhePks13pinX7SOGVWsP6AHu2kezAIYMuSmajpj6V/W9S2cuZAO LkjIcyP2/GwzZTiEz1c67g/ULO4QJfCAo04RbIv4gg8PlxXtKcrHV2Vbg4+HQUFFMrUu Eegw== X-Gm-Message-State: AJaThX6jOKuq3ZsmvMf/R7HogrXHtIKe8FyFBICNsUXL/ttxFMWw7SAY XDvDiiKLQLsPBJPxT7RgYi0= X-Google-Smtp-Source: AGs4zMZaeW1OATxd4BlOZP/jeQ6k6CfnTXi4UOPw0gShkW2p5wxRBwDPsNEPFy5k3Axhn7aDQ3ls8Q== X-Received: by 10.46.71.82 with SMTP id u79mr3032371lja.52.1510568449780; Mon, 13 Nov 2017 02:20:49 -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 s76sm2818192lfi.56.2017.11.13.02.20.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2017 02:20:48 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.89) (envelope-from ) id 1eEBrK-0002RY-Dc; Mon, 13 Nov 2017 11:20:54 +0100 From: Johan Hovold To: Lee Jones Cc: Daniel Thompson , Jingoo Han , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable , Matthias Kaehlcke Subject: [PATCH 3/3] backlight: tps65217_bl: fix device-tree node lookup Date: Mon, 13 Nov 2017 11:20:49 +0100 Message-Id: <20171113102049.9342-3-johan@kernel.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113102049.9342-1-johan@kernel.org> References: <20171113102049.9342-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);