From nobody Thu Feb 12 21:47:01 2026 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86E5E2F5E for ; Sat, 4 Jan 2025 11:51:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735991469; cv=none; b=Abb1STJib67ZB8oNN8LBBH5Tug8H/bieoiuUWvKCJ/LLp4bsEUhwelKFQ8YnRsvM+VJkxsfnghMoEKM0YlHxDz/T8VtJWlUEWSwzb4x3okYCnCCXyOX8RJVjFXPRQKhsL+hfKwV10Bvmvz01bkHPkCrFQ+QXPdmgDCUTc0CUsx8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735991469; c=relaxed/simple; bh=+Y96WcT73RE9pjwxGLB61Vesyp0+i6NpHt/0z2hrbks=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AlbAs01moPJKUCUlezF6bzoSZfxiV0Xq9mallflkniDMNPrXsITuTD4wLJbOCea7P9z8inLUZHpljq8vNQoBrDLKFM1JW4z0bLFg96IAF4ZkfT4HH1AzvSP6x5pDKnicCjFaH669bPb9hL3NeSW0NmeeTPw61sZa/Ht3hb+3ltE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=zA+0bkFr; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zA+0bkFr" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2ee989553c1so18273836a91.3 for ; Sat, 04 Jan 2025 03:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735991467; x=1736596267; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=azIIlNi42ZA+Aftua6olVbTlZOJw9KFY91ZXWCLaUp4=; b=zA+0bkFrqIz6chQpu294mRYzwvxvPMWF/6EGu0kIXmPybNuij5gmeMjQfr4tG20fHm XIq05PLTJq3t8ShplQcVh3MOi+sEpdiXOILbYwu09F+PKi+T2kct5pAplyqwciM9mh7A G/8KG/R1NZxxmyMZlfv+SHaskfWQq3ikD6GiM6oVsh+bbFeekgsotYcUNlStO+W17JNP zM0l+1sH6rE4qOxx+2lUpxo6fF/jjM4dSXwJdBKR3BeJhAAYlwuzywbK0gbsfYxZZOuf IkmgTg+7ECBlog6EFIChw+DJ2VjGFcMEr3+fat8J7Qvj+2OqHtxiBg1pAOOFyVA6T2XJ kMog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735991467; x=1736596267; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=azIIlNi42ZA+Aftua6olVbTlZOJw9KFY91ZXWCLaUp4=; b=ij2pwa1DLazCJDRovP/qZ7H8d5AoZUL/zbfM/QcaQO5SlQOrps0Txw43TIfIJgXE3f rZFkOeIhHZSkGhrFctMNacE9JB7i/aAI0x0wUkd7UNpPoh+E5CKEmHK+gpFjN9/rMDDm IenwzgGbUhWEwW4kpNtbL1v/hBXcKbbsrhy+bpfwSGPz1zHPF1KuN2OcaZeQNzueE9Bt VZSmQIfyFlImgBsWJs24esdVtBu5Q4HrFxPq+7p7CgCxMNsrf5M5aDVnWSyUQpXZ7vOn r4r+AZvJQqf/VQG4MRJ5+4wRuepADxXH3BQUlvpQ7JljQHDT2MC1pg+R4tgbK9S2zaZ0 VVOQ== X-Gm-Message-State: AOJu0Yw5jcmQaZHnDDLPyZLkVSeS/H39yA2LsVvMFx6pjNrSF/GVn7IP 8hDmaKizo4X1EimX+2W0W71XsFaEzgSLVbUy3MSFI+hmT5hl4N1ctklQ/vx8qg== X-Gm-Gg: ASbGncsONSTnGEzg3K1vT3zoIb+WUY3PtYiq5EZ844lfD/aNkZtBZVzfLUAjdMHkKSY CPaigoakJT+wTNsPOzHKOPRRPmpsA/t3QXu5AWK9CepPqeQwJZpphVmzjJAJDLFVoAV5Ke3UGKA dL9bL/iIdP8HUmUBOqoPzc/r2w0lsGAmpyyBQ2jCu1hWvaPncM0kjg52czgQZOnOgTGPcZRxIlr 3gN8Dn9ueoWgvVo6uqh7WA4kkwcy0t+gYbk1ClKL674VW0cJXVd50HXyU7ZFN4DJjCBhrn/YjIf 4fWO8m9B X-Google-Smtp-Source: AGHT+IFfKCPMDPwgCOsaJfQ0eUgWQcSepACDmt2pp7HyZ6AmMtoZ+naIVsNtcPJPUG+lSgZuvTbZ1A== X-Received: by 2002:a17:90b:2d43:b0:2ef:2d9f:8e58 with SMTP id 98e67ed59e1d1-2f452eedb4cmr68423454a91.34.1735991466815; Sat, 04 Jan 2025 03:51:06 -0800 (PST) Received: from localhost.localdomain ([36.255.17.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f4477ec9d1sm32982833a91.29.2025.01.04.03.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 03:51:06 -0800 (PST) From: Manivannan Sadhasivam To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-kernel@vger.kernel.org, bartosz.golaszewski@linaro.org, Manivannan Sadhasivam , kernel test robot Subject: [PATCH 1/2] regulator: Guard of_regulator_bulk_get_all() with CONFIG_OF Date: Sat, 4 Jan 2025 17:20:57 +0530 Message-Id: <20250104115058.19216-2-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250104115058.19216-1-manivannan.sadhasivam@linaro.org> References: <20250104115058.19216-1-manivannan.sadhasivam@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since the definition is in drivers/regulator/of_regulator.c and compiled only if CONFIG_OF is enabled, building the consumer driver without CONFIG_OF and with CONFIG_REGULATOR will result in below build error: ERROR: modpost: "of_regulator_bulk_get_all" [drivers/pci/pwrctrl/pci-pwrctl= -slot.ko] undefined! Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202412181640.12Iufkvd-lkp@int= el.com/ Fixes: 27b9ecc7a9ba ("regulator: Add of_regulator_bulk_get_all") Signed-off-by: Manivannan Sadhasivam Reviewed-by: Bartosz Golaszewski --- include/linux/regulator/consumer.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index 8c3c372ad735..85be83c8fa17 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -175,6 +175,8 @@ struct regulator *__must_check of_regulator_get_optiona= l(struct device *dev, struct regulator *__must_check devm_of_regulator_get_optional(struct devic= e *dev, struct device_node *node, const char *id); +int __must_check of_regulator_bulk_get_all(struct device *dev, struct devi= ce_node *np, + struct regulator_bulk_data **consumers); #else static inline struct regulator *__must_check of_regulator_get_optional(str= uct device *dev, struct device_node *node, @@ -189,6 +191,13 @@ static inline struct regulator *__must_check devm_of_r= egulator_get_optional(stru { return ERR_PTR(-ENODEV); } + +static inline int of_regulator_bulk_get_all(struct device *dev, struct dev= ice_node *np, + struct regulator_bulk_data **consumers) +{ + return 0; +} + #endif =20 int regulator_register_supply_alias(struct device *dev, const char *id, @@ -223,8 +232,6 @@ int regulator_disable_deferred(struct regulator *regula= tor, int ms); =20 int __must_check regulator_bulk_get(struct device *dev, int num_consumers, struct regulator_bulk_data *consumers); -int __must_check of_regulator_bulk_get_all(struct device *dev, struct devi= ce_node *np, - struct regulator_bulk_data **consumers); int __must_check devm_regulator_bulk_get(struct device *dev, int num_consu= mers, struct regulator_bulk_data *consumers); void devm_regulator_bulk_put(struct regulator_bulk_data *consumers); @@ -483,12 +490,6 @@ static inline int devm_regulator_bulk_get(struct devic= e *dev, int num_consumers, return 0; } =20 -static inline int of_regulator_bulk_get_all(struct device *dev, struct dev= ice_node *np, - struct regulator_bulk_data **consumers) -{ - return 0; -} - static inline int devm_regulator_bulk_get_const( struct device *dev, int num_consumers, const struct regulator_bulk_data *in_consumers, --=20 2.25.1 From nobody Thu Feb 12 21:47:01 2026 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 517851B4F24 for ; Sat, 4 Jan 2025 11:51:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735991472; cv=none; b=pUox2R50Zsryz9jc9EzWWodcR5AIaVND/V4YJXYPOzNWZxJdR8+YYehRSzIdxY2cd3z80GCUe/C/jaG3oPIANY/RYOPGUYkbso+K3sIzVmfjrGfxcjXrRqMBrJVhnLWazBACleHFZo3EIb+iE5qEUu01SagagOlC2Ytl5asUuIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735991472; c=relaxed/simple; bh=agrIegjLRPwH8HGZlxd+Pw+EoosEHueg+aCnGAxabYo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SmPqKYm3ivSgVA1yqboSXjXeYFst921QnvhVQ/eC4Hy61pF0ffHcPNRDY2YfIUumL3SASNtn8I1iN1FQu8uiIJiOVXEZIDgI3zklb2CCwD242EGIrtaCgJd51klmw+eQK7bg2/+R8UtpkjKY/E1P3p4D0ueHcAMMa44NKt7yVNQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=AhXbdjh7; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AhXbdjh7" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2ee397a82f6so18787820a91.2 for ; Sat, 04 Jan 2025 03:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735991469; x=1736596269; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Vv9CrLVZ/cMys9nu5kntuzPv4Su32Qf5rW+6tA3plck=; b=AhXbdjh7FpLmT7HV/qLEBfbudGUIqrNJmSpxWRi4x4ble6gtjD9N3oYcXC/7oshRHw GvqxkPcT1iVGNEhxToNfDDzvl/qmiq9gPtNibstYHbdtbViNcplzKSv6RTSj5JjL4DOi PlB/U+lXEm563Z/ReoMMJGnqDirvtC6lLjk2eeQ7kNm2Aq4bOuxp+EDfwzJbkw4a0lvK 0vhMnEWu6YVJobUoXtcnj91Ylxr7Y89sBLZdEgXWmxkXkkUqFLfqKqm1dxSzP2KGncmS w65ZrZq91am4fpwBUsdWJolf4L0Zd2AMiyna83Sa8ahUqXW7i/EJRvN6yH/r9aKMpyf2 WPDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735991469; x=1736596269; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vv9CrLVZ/cMys9nu5kntuzPv4Su32Qf5rW+6tA3plck=; b=Ka54cpSzsiNnlfVfcLmF4SxSd28YVtYJV+8eRTxNS38T5sDL+ngXFyHeTjPGBAGHPp 0LHid86Ywsrcb4I0jk0wZkCkUccn2ONQuiiXiqjmkWApueUdNY+HxkekmkvJwRHfIo1e ROI6rr3QHgATgeGQWPBNOPWNMfO5r0DSSe7HrIQbztCKP1Mo4YriEM+WsWJFGOsyjd3T RiHS7jdAvh0ARA52Swk6nn9kLZDZq1hzkEv6pEUjgp19dmSUoQxYm+UahxIfkB1JxCQa b8q1F663MHr3AS9GcO0nM1oZJxaHaFBzRg+pd3NtCluwUYMICQ5J/FnL1u0mve7Im4qV DBog== X-Gm-Message-State: AOJu0YzVBIobrtB2SnzLWGlwqYn5Y/PDbCSSaJdoSYnEWAHiC3glLRWp sTH71zi3dZxUn4glmbPXQ6aUfIc6TAqwiqyOJC7ncTITShBB438H9qRiva3mJg== X-Gm-Gg: ASbGnctT05x/tWfKuoRseidSJ5MiakwOI/BQu27YfJnGqChJLMsdwkXb741B65rnSoS kPOifSoJEdn0YZieZnExLY1VZogBH3njPTMuct5TSLy/4N7sDtolWJ1/1vweshmFdvtmzVLMOT4 sVVet4mWGcpFbloB9vNkiitEgpiVBNpnOzfJLtKbzd4T7q7ML++lZTWu2HN/syUEni+GRO1hbui vKG1gykncU1wR8ix0I4TFTgKnEiC9K+eaKJzjUvPMqAil7rQ02twtoGOgfhr2rB3uh0B02kSX7g OsKM30F0 X-Google-Smtp-Source: AGHT+IEskpZpq+uU/W2vP+fVC2P5tY0vc07qz8MjdOFJAdvGD8cqcE/v5fuWTEyuWY2dcGszaaKhIA== X-Received: by 2002:a17:90b:2b8f:b0:2ee:f1e3:fd21 with SMTP id 98e67ed59e1d1-2f452eb3cecmr70442336a91.25.1735991469645; Sat, 04 Jan 2025 03:51:09 -0800 (PST) Received: from localhost.localdomain ([36.255.17.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f4477ec9d1sm32982833a91.29.2025.01.04.03.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 03:51:09 -0800 (PST) From: Manivannan Sadhasivam To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-kernel@vger.kernel.org, bartosz.golaszewski@linaro.org, Manivannan Sadhasivam , kernel test robot Subject: [PATCH 2/2] regulator: Move OF_ API declarations/definitions outside CONFIG_REGULATOR Date: Sat, 4 Jan 2025 17:20:58 +0530 Message-Id: <20250104115058.19216-3-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250104115058.19216-1-manivannan.sadhasivam@linaro.org> References: <20250104115058.19216-1-manivannan.sadhasivam@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since these are hidden inside CONFIG_REGULATOR, building the consumer drivers without CONFIG_REGULATOR will result in the following build error: >> drivers/pci/pwrctrl/slot.c:39:15: error: implicit declaration of function 'of_regulator_bulk_get_all'; did you mean 'regulator_bulk_get'? [-Werror=3Dimplicit-function-declaration] 39 | ret =3D of_regulator_bulk_get_all(dev, dev_of_node(dev), | ^~~~~~~~~~~~~~~~~~~~~~~~~ | regulator_bulk_get cc1: some warnings being treated as errors This also removes the duplicated definitions that were possibly added to fix the build issues. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202501020407.HmQQQKa0-lkp@int= el.com/ Fixes: 27b9ecc7a9ba ("regulator: Add of_regulator_bulk_get_all") Signed-off-by: Manivannan Sadhasivam --- include/linux/regulator/consumer.h | 78 ++++++++++++------------------ 1 file changed, 32 insertions(+), 46 deletions(-) diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index 85be83c8fa17..bcba3935c6f9 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -168,38 +168,6 @@ int devm_regulator_get_enable_read_voltage(struct devi= ce *dev, const char *id); void regulator_put(struct regulator *regulator); void devm_regulator_put(struct regulator *regulator); =20 -#if IS_ENABLED(CONFIG_OF) -struct regulator *__must_check of_regulator_get_optional(struct device *de= v, - struct device_node *node, - const char *id); -struct regulator *__must_check devm_of_regulator_get_optional(struct devic= e *dev, - struct device_node *node, - const char *id); -int __must_check of_regulator_bulk_get_all(struct device *dev, struct devi= ce_node *np, - struct regulator_bulk_data **consumers); -#else -static inline struct regulator *__must_check of_regulator_get_optional(str= uct device *dev, - struct device_node *node, - const char *id) -{ - return ERR_PTR(-ENODEV); -} - -static inline struct regulator *__must_check devm_of_regulator_get_optiona= l(struct device *dev, - struct device_node *node, - const char *id) -{ - return ERR_PTR(-ENODEV); -} - -static inline int of_regulator_bulk_get_all(struct device *dev, struct dev= ice_node *np, - struct regulator_bulk_data **consumers) -{ - return 0; -} - -#endif - int regulator_register_supply_alias(struct device *dev, const char *id, struct device *alias_dev, const char *alias_id); @@ -380,20 +348,6 @@ devm_regulator_get_optional(struct device *dev, const = char *id) return ERR_PTR(-ENODEV); } =20 -static inline struct regulator *__must_check of_regulator_get_optional(str= uct device *dev, - struct device_node *node, - const char *id) -{ - return ERR_PTR(-ENODEV); -} - -static inline struct regulator *__must_check devm_of_regulator_get_optiona= l(struct device *dev, - struct device_node *node, - const char *id) -{ - return ERR_PTR(-ENODEV); -} - static inline void regulator_put(struct regulator *regulator) { } @@ -701,6 +655,38 @@ regulator_is_equal(struct regulator *reg1, struct regu= lator *reg2) } #endif =20 +#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_REGULATOR) +struct regulator *__must_check of_regulator_get_optional(struct device *de= v, + struct device_node *node, + const char *id); +struct regulator *__must_check devm_of_regulator_get_optional(struct devic= e *dev, + struct device_node *node, + const char *id); +int __must_check of_regulator_bulk_get_all(struct device *dev, struct devi= ce_node *np, + struct regulator_bulk_data **consumers); +#else +static inline struct regulator *__must_check of_regulator_get_optional(str= uct device *dev, + struct device_node *node, + const char *id) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct regulator *__must_check devm_of_regulator_get_optiona= l(struct device *dev, + struct device_node *node, + const char *id) +{ + return ERR_PTR(-ENODEV); +} + +static inline int of_regulator_bulk_get_all(struct device *dev, struct dev= ice_node *np, + struct regulator_bulk_data **consumers) +{ + return 0; +} + +#endif + static inline int regulator_set_voltage_triplet(struct regulator *regulato= r, int min_uV, int target_uV, int max_uV) --=20 2.25.1