Received: by 10.223.164.202 with SMTP id h10csp265476wrb; Mon, 13 Nov 2017 06:11:27 -0800 (PST) X-Google-Smtp-Source: AGs4zMbfngX4991UXNMlmHxl2XonJnpL6OdAGMBQvAnoWvkP9T8jqgfmFVGj5V51+IJjaRlcGZfl X-Received: by 10.98.206.133 with SMTP id y127mr9794763pfg.152.1510582286904; Mon, 13 Nov 2017 06:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510582286; cv=none; d=google.com; s=arc-20160816; b=Q+T3gu6IxSOM+zlaYhQ9k8TNORBDs9ncWa/eNxf5KB9JqnYaQh4H9AF85WMj7+xlUX Ckv6wfPv2+B/318fxmmgxSlQJHpkHWwhPzE2yJDFmkGfV9bbNwYpY7IdMWaNfcEXd/hL ZkWKMCl84jsbX3MfEkN9TdDHEO+yPArYyPDcH2S4s/ma86EO6qcSOW79uvKS70SW3//Z zf4gXxOvK0yJ8w82sOpbo6aTKVNJUDz+3YkHBBaksyogt9lwvkXpLVwF76PtqgIhBklp 8YPpb+6Ub4Qxod4W5f4HaVY4E1Sfn6y1cJE/B/UCwwrQdz46+aafGFA+4x8PEc7r8no1 ATWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=WbGj3P7Gn36uvhmhHCdru1v4Xv0hIWQmbXswHnQbGM8=; b=t6jqGstcldAIsh/McwG4fvIutigGPk0h64rgju7bm089cJg4c7WfMtAldMPTAehR51 QHME862y7OqxlmnVLnLhovnSgvM9IWKCPIdzqD86TBeH0eWCsdVC19F5M4zBvP9OHcL0 RLR8ajP6cBgdex6FRnlB6M1PN+6X4J3Z1BCe40OwprRz9AF1qLg4ZbZONe7S/wX1aPdn pwACDK3+qlZmIgt3FhCM9rZ2BxUBdApccLYRomFuaQTWBrekOeJTTYP4wYKto6MlVYgr 7/Fh62ZiV1iIboZ2xhdY2Br8KWlusp/ZztArVdxgTmPA4VzuEWzg9lmZVHqRq/gdzAJY M+4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UvQvKhIT; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g68si9010424pfc.403.2017.11.13.06.11.13; Mon, 13 Nov 2017 06:11:26 -0800 (PST) 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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UvQvKhIT; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752839AbdKMOK0 (ORCPT + 93 others); Mon, 13 Nov 2017 09:10:26 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:9236 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337AbdKMOKY (ORCPT ); Mon, 13 Nov 2017 09:10:24 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id vADEAGNu023009; Mon, 13 Nov 2017 08:10:16 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1510582216; bh=c9ZCRBElG/NQHvK2wJOFNr4zyKeiTvGWAs48K1rqqII=; h=Subject:To:References:CC:From:Date:In-Reply-To; b=UvQvKhITJSoijVzz/mTcdSnKcd53Uof2ozxuYRvInZBUeza1mEPFV7uCcD9ZpVum4 UIAXnqXRrochs3jX9io4BdlRMjwJ4mHLoHtbFtlzU+c+bAlB+/ZDFqkPhZ+mGFApBP 9kkPo7oh5yu2vPCgBb8mlzEs2KJDPzSJMp0uRVnI= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id vADEAGqY018793; Mon, 13 Nov 2017 08:10:16 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Mon, 13 Nov 2017 08:10:15 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Mon, 13 Nov 2017 08:10:15 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id vADEADsr007383; Mon, 13 Nov 2017 08:10:14 -0600 Subject: Re: [PATCH 2/3] Input: twl6040-vibra: fix child-node lookup To: Johan Hovold , Dmitry Torokhov References: <20171111154339.16875-1-johan@kernel.org> <20171111154339.16875-2-johan@kernel.org> CC: , , stable , "H . Nikolaus Schaller" From: Peter Ujfalusi Message-ID: Date: Mon, 13 Nov 2017 16:10:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20171111154339.16875-2-johan@kernel.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-11-11 17:43, Johan Hovold wrote: > Fix child-node lookup during probe, which ended up searching the whole > device tree depth-first starting at parent rather than just matching on > its children. > > Later sanity checks on node properties (which would likely be missing) > should prevent this from causing much trouble however, especially as the > original premature free of the parent node has already been fixed > separately (but that "fix" was apparently never backported to stable). > > Fixes: e7ec014a47e4 ("Input: twl6040-vibra - update for device tree support") > Fixes: c52c545ead97 ("Input: twl6040-vibra - fix DT node memory management") > Cc: stable # 3.6 Note that of_get_child_by_name() is not present in 3.6, this was the reason the original implementation was using of_find_node_by_name() > Cc: Peter Ujfalusi > Cc: H. Nikolaus Schaller > Signed-off-by: Johan Hovold > --- > drivers/input/misc/twl6040-vibra.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c > index 5690eb7ff954..15e0d352c4cc 100644 > --- a/drivers/input/misc/twl6040-vibra.c > +++ b/drivers/input/misc/twl6040-vibra.c > @@ -248,8 +248,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev) > int vddvibr_uV = 0; > int error; > > - of_node_get(twl6040_core_dev->of_node); > - twl6040_core_node = of_find_node_by_name(twl6040_core_dev->of_node, > + twl6040_core_node = of_get_child_by_name(twl6040_core_dev->of_node, > "vibra"); > if (!twl6040_core_node) { > dev_err(&pdev->dev, "parent of node is missing?\n"); > - P�ter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki From 1583941916620350550@xxx Mon Nov 13 09:18:44 +0000 2017 X-GM-THRID: 1583785007086064291 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread