From patchwork Tue Mar 6 12:33:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 130785 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3883375lja; Tue, 6 Mar 2018 04:33:52 -0800 (PST) X-Google-Smtp-Source: AG47ELv7duFC5D2R+R1dE3V1nac342rIiK4hXS70D2Tb+uUGy+snZXU1fXa14FAwRyafBNEqGmNc X-Received: by 2002:a17:902:2e04:: with SMTP id q4-v6mr16511752plb.22.1520339632581; Tue, 06 Mar 2018 04:33:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520339632; cv=none; d=google.com; s=arc-20160816; b=xsVz6aGSb9Twd1BKAA9mUwRE/J2HozxAz9rJbx2tAXD7SPEV4+y3PjOqNy+/ja8+tw rZ9xqQ8ifRDHtitqKQBUuhoT7w00y3dJ/KHumsl3YuQOImPxM0mZVR5Jv28PrYYWREhh TbNSamu2WuOs3jVysog15F8PiPefMzDtElFKVpgN3GYd57Ahp/xZwbQ8YX2CXypmuzEe 6SQ8fF1ik0NQAwZ+ZUdfg+KFMkH8D2iYh+TBwG2tfcg9AYYKmhzdfV1MTZjyLarANTI/ aena/gADaYKTLvOaU2bSiumca8VlnAzMmQdw3cGR1FkLK3PVyMFkO8AnP4vLkq4U2Por xU/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=kzcgrF6CNcOk/7bq4rNnwz7/zI2osfKvxxGRnk9SP8s=; b=r4r2FXRUMb28AOpX5vM7QViSwJsKPQAFYZBVLksTb1daMsXmFN5W9Ouk113KYxvdYD yJYq8VHUpJNh0NBFbtQIum3VgXtWnyb0dfQnEGYdxoEQNxOXEh6OHOmOuzIVEc3C6RJH wm+/2rbA994bnsbETEOHWDkWp/ri/kdw1n+2d1YIBtkAEkoIarPZOVHY80JqsL0Fjzvg wX0qSlgk0E7+twf1e/p134zr5LQXnKg0e7dXNRgfi1aMxsbzMuTW6VXSrBgijvxLHt43 ZB5428XPhE0yDYBY9R9thcAo9Fu5/U7RX7J74zH6WqJX5+usQtl3faAzlw3aDN3syX9Z CWJw== 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 o2-v6si11013458plk.457.2018.03.06.04.33.52; Tue, 06 Mar 2018 04:33:52 -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; 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 S1753522AbeCFMdt (ORCPT + 28 others); Tue, 6 Mar 2018 07:33:49 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:47683 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750897AbeCFMdr (ORCPT ); Tue, 6 Mar 2018 07:33:47 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0M5P83-1eTYgL3i9P-00zYKa; Tue, 06 Mar 2018 13:33:34 +0100 From: Arnd Bergmann To: Liam Girdwood , Mark Brown Cc: Arnd Bergmann , Maciej Purski , Chunyan Zhang , Tirupathi Reddy , linux-kernel@vger.kernel.org Subject: [PATCH] regulator: don't try to use DT information without CONFIG_OF Date: Tue, 6 Mar 2018 13:33:09 +0100 Message-Id: <20180306123333.84344-1-arn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e57kH/LaWygaHmfwU56/mJHKJ7g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The coupled regulator support requires CONFIG_OF today, otherwise we get a link error: drivers/regulator/core.o: In function `regulator_fill_coupling_array': core.c:(.text+0x3e44): undefined reference to `of_parse_coupled_regulator' drivers/regulator/core.o: In function `regulator_register': core.c:(.text+0x5eb4): undefined reference to `of_get_n_coupled' core.c:(.text+0x5f08): undefined reference to `of_check_coupling_data' This changes the affected functions to return success when CONFIG_OF is disabled, which should result in the same behavior as before. Fixes: cf6fc8064766 ("regulator: core: Resolve coupled regulators") Signed-off-by: Arnd Bergmann --- drivers/regulator/core.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index dedf737a2bad..dbc3381105fb 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4351,6 +4351,9 @@ static int regulator_register_fill_coupling_array(struct device *dev, { struct regulator_dev *rdev = dev_to_rdev(dev); + if (!IS_ENABLED(CONFIG_OF)) + return 0; + if (regulator_fill_coupling_array(rdev)) rdev_dbg(rdev, "unable to resolve coupling\n"); @@ -4359,7 +4362,12 @@ static int regulator_register_fill_coupling_array(struct device *dev, static int regulator_resolve_coupling(struct regulator_dev *rdev) { - int n_phandles = of_get_n_coupled(rdev); + int n_phandles; + + if (!IS_ENABLED(CONFIG_OF)) + return 0; + + n_phandles = of_get_n_coupled(rdev); if (n_phandles + 1 > MAX_COUPLED) { rdev_err(rdev, "too many regulators coupled\n");