From patchwork Sun Mar 2 07:44:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 3748771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9F36DBF13A for ; Sun, 2 Mar 2014 07:46:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92A1020364 for ; Sun, 2 Mar 2014 07:46:54 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 835EE20357 for ; Sun, 2 Mar 2014 07:46:53 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WK15j-0004g9-1Y; Sun, 02 Mar 2014 07:45:43 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WK15V-0003p9-H0; Sun, 02 Mar 2014 07:45:29 +0000 Received: from smtp37.i.mail.ru ([94.100.177.97]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WK15E-0003n4-6l for linux-arm-kernel@lists.infradead.org; Sun, 02 Mar 2014 07:45:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=zxQMjj0VlxWu6S/bK2wjNaREfBRIHGWoEnP0JsnQddc=; b=oeIe5+ymMdjHF1N2dQkIPgMSvrl7xiQlDeoKJz1gibklICu4pkSDU8kn6oBICdzB1rJkaTu6LB6rJBpdN5+pEI8MKkBHO+LQQ9I/MBIXTzrCS0etxN/eDA2TGtEwbtYR4zPJNfVTADyQYdx8H1pn2qfZZh6MD2lyg0BgDzJIgsg=; Received: from [188.134.40.128] (port=54763 helo=shc.zet) by smtp37.i.mail.ru with esmtpa (envelope-from ) id 1WK14r-0000v7-Np; Sun, 02 Mar 2014 11:44:50 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/4] regulator: mc13xxx: Fix probing with DT Date: Sun, 2 Mar 2014 11:44:35 +0400 Message-Id: <1393746275-9253-4-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393746275-9253-1-git-send-email-shc_work@mail.ru> References: <1393746275-9253-1-git-send-email-shc_work@mail.ru> X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140302_024512_821135_C65CF2FF X-CRM114-Status: UNSURE ( 7.34 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) Cc: Samuel Ortiz , Alexander Shiyan , Liam Girdwood , Mark Brown , Sascha Hauer , Shawn Guo , Lee Jones X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The nodes of regulators should be retrieved from parent device. Bug was be introduced by commit (regulator: mc13xxx: Fix NULL pointer error in non-DT mode) in conjuction with (mfd: Revert "mfd: Always assign of_node in mfd_add_device()"). Signed-off-by: Alexander Shiyan --- drivers/regulator/mc13xxx-regulator-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c index bf75fca..05b9717 100644 --- a/drivers/regulator/mc13xxx-regulator-core.c +++ b/drivers/regulator/mc13xxx-regulator-core.c @@ -167,10 +167,10 @@ int mc13xxx_get_num_regulators_dt(struct platform_device *pdev) struct device_node *parent; int num; - if (!pdev->dev.of_node) + if (!pdev->dev.parent->of_node) return -ENODEV; - parent = of_get_child_by_name(pdev->dev.of_node, "regulators"); + parent = of_get_child_by_name(pdev->dev.parent->of_node, "regulators"); if (!parent) return -ENODEV; @@ -189,10 +189,10 @@ struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt( struct device_node *parent, *child; int i, parsed = 0; - if (!pdev->dev.of_node) + if (!pdev->dev.parent->of_node) return NULL; - parent = of_get_child_by_name(pdev->dev.of_node, "regulators"); + parent = of_get_child_by_name(pdev->dev.parent->of_node, "regulators"); if (!parent) return NULL;