From nobody Thu Feb 12 23:08:51 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