Received: by 10.192.165.148 with SMTP id m20csp700182imm; Fri, 4 May 2018 18:48:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqy3bHHVrDIW+0EreMBCDEULzbSnHBWZQEsjES9bGqOgl4oWBAlovx1X+yDU/GI2wAhEmCa X-Received: by 2002:a65:5183:: with SMTP id h3-v6mr23531531pgq.58.1525484895416; Fri, 04 May 2018 18:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525484895; cv=none; d=google.com; s=arc-20160816; b=XILsjQta+0JoVag3tlzLTNaOKtnXM29JdIVFuHwuil7RYBF8jCztUS7do0sY2YAX4r Ad2gNL7Ly85izH7yEyahcjSoihJYJoKbsKBXoFri1nQ+eVebv0vGAoiyNm6Bk8m9eOJD zIuMaL/L80n0B2C3HsI+NpGo31bwEKsOQeZWQr0ChGkWfJC3eT1NsmDeBZZgssmdoQ8X GpYUr56bEMtwpNfdJ5zKKnsb/yMh3qG55OHmgCZjyxH3ZqlSdTbCYrnFlU1JuHcFAS2e 8WYk+CpgGIMeYKbUuObbCQn2EEHX1T4J5ViVI3AXsRjjPBiKuBoFFqe2dEJqztU5kiG2 5KEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=aMo6Y+PKYkNSQZOAk1Ln+xYfxw3zqr9vmzwPzx1X7K8=; b=KVgICysjG5D2acYo13yrjQHa7jq+bCKffKlB74RYEg14YsxRTKv4uI5VbnxfYiFX+i a7LASCGShQ2okrX4JU05xQBuQiUpqeX0QjtGXCH3NXjKh7dBbxFZsanbStkrNwGe+LdT y3RDxHSxAVsTunoEGeoreUpubh7bjTqb7MwrhgPZFYZJGLu90/RxlFx5ilJtHlDLR1WG cc6Yf0rWjdJ+6hiXvQDk1mLaXq9WJAbCysai0ywsWyK0n1VNutA/P5s93cM+TAvX0LvM 61iQirJbursa3Mf1Cha0sxH5ykNiFHPrTLJ25Lb4DOPy4UJKpfqEjfidyLNuK+KSeCGK wSDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=vlaiZ0Yv; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e29-v6si17029591plj.518.2018.05.04.18.48.00; Fri, 04 May 2018 18:48:15 -0700 (PDT) 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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=vlaiZ0Yv; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752025AbeEEBoe (ORCPT + 99 others); Fri, 4 May 2018 21:44:34 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:36970 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751739AbeEEBod (ORCPT ); Fri, 4 May 2018 21:44:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=aMo6Y+PKYkNSQZOAk1Ln+xYfxw3zqr9vmzwPzx1X7K8=; b=vlaiZ0YvWR2/ ARbrF7AKpFzeEKTgsgVvManIO1Ch/uF0v1xPJPaXFa5TOS7hlCkio62G/Ru/5P1iKwmVQnliUUzvi YTkU8X5axW7ERIfHiN4q6RZ24+mkt+NAKAvwrC+A6bkc6EtN3fgvtLLx10qEyffILy4hKtTFkN6Mo jTSVA=; Received: from [211.55.52.15] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fEmFE-0006WE-KS; Sat, 05 May 2018 01:44:17 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id ADEDE44007A; Sat, 5 May 2018 02:44:13 +0100 (BST) From: Mark Brown To: Changbin Du Cc: Mark Brown , yamada.masahiro@socionext.com, michal.lkml@markovi.net, tglx@linutronix.de, mingo@redhat.com, akpm@linux-foundation.org, x86@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, arnd@arndb.de, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Applied "regulator: add dummy function of_find_regulator_by_node" to the regulator tree In-Reply-To: <1525179614-14571-3-git-send-email-changbin.du@intel.com> Message-Id: <20180505014413.ADEDE44007A@finisterre.ee.mobilebroadband> Date: Sat, 5 May 2018 02:44:13 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: add dummy function of_find_regulator_by_node has been applied to the regulator tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 08813e0ec1cb48e53c86a24d88d26b26878e7b6e Mon Sep 17 00:00:00 2001 From: Changbin Du Date: Wed, 2 May 2018 21:44:57 +0800 Subject: [PATCH] regulator: add dummy function of_find_regulator_by_node If device tree is not enabled, of_find_regulator_by_node() should have a dummy function since the function call is still there. This is to fix build error after CONFIG_NO_AUTO_INLINE is introduced. If this option is enabled, GCC will not auto-inline functions that are not explicitly marked as inline. In this case (no CONFIG_OF), the copmiler will report error in function regulator_dev_lookup(). W/O NO_AUTO_INLINE, function of_get_regulator() is auto-inlined and then the call to of_find_regulator_by_node() is optimized out since of_get_regulator() always return NULL. W/ NO_AUTO_INLINE, the return value of of_get_regulator() is a variable so the call to of_find_regulator_by_node() cannot be optimized out. So we need a stub of_find_regulator_by_node(). static struct regulator_dev *regulator_dev_lookup(struct device *dev, const char *supply) { struct regulator_dev *r = NULL; struct device_node *node; struct regulator_map *map; const char *devname = NULL; regulator_supply_alias(&dev, &supply); /* first do a dt based lookup */ if (dev && dev->of_node) { node = of_get_regulator(dev, supply); if (node) { r = of_find_regulator_by_node(node); if (r) return r; ... Signed-off-by: Changbin Du Signed-off-by: Mark Brown --- drivers/regulator/internal.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/internal.h b/drivers/regulator/internal.h index abfd56e8c78a..24fde1e08f3a 100644 --- a/drivers/regulator/internal.h +++ b/drivers/regulator/internal.h @@ -56,14 +56,19 @@ static inline struct regulator_dev *dev_to_rdev(struct device *dev) return container_of(dev, struct regulator_dev, dev); } -struct regulator_dev *of_find_regulator_by_node(struct device_node *np); - #ifdef CONFIG_OF +struct regulator_dev *of_find_regulator_by_node(struct device_node *np); struct regulator_init_data *regulator_of_get_init_data(struct device *dev, const struct regulator_desc *desc, struct regulator_config *config, struct device_node **node); #else +static inline struct regulator_dev * +of_find_regulator_by_node(struct device_node *np) +{ + return NULL; +} + static inline struct regulator_init_data * regulator_of_get_init_data(struct device *dev, const struct regulator_desc *desc, -- 2.17.0