From nobody Wed Feb 11 07:07:31 2026 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF6991A08DB; Sat, 26 Apr 2025 17:52:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689950; cv=none; b=EtGQ8Ogk/1uU9XYnCCKBeNK//ajuR8WVaaq2Xv8vhcVeFdwkEWVMBz9pURip+PE2Jz2Gl8O0xDhDUBhH2szl06S/Kslh17KVFO0KThqf/mhZKO7pvSNubcJYndr0WPvz7KmiXravWnBhlDnYRknuAcVRHARXqa/Lia1iBf4qugA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689950; c=relaxed/simple; bh=vJgy8tQMrt+aoG2ttElS3cDlnT/MD3d+wjc/TizjeCo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sBCQDPBNQXtXFhycQwEBV2RMXibPLPUiqP3LnMQgMLKij95bPr3ecthguCISdZETKIkHa4+LvA0nTWi0p8qXj4nqBANoo1hSlWUXEJorDfqFaCPggqEiQho3XlLIFERToBLC7dUZY0Fx+HNJBxwdFL47YH+/F/S/+we9YeWNhSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=K5QGhbeI; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="K5QGhbeI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=nODb2/Dg6J9XfTDKpylGMZozA/0cRZe7/w52L6ftxRw=; b=K5QGhbeIogdaidpq aGoVoSKkoHsY1l/0ieb852CntaIRHSasdmM20mNfyyaG1hVgV0G89bXid7xyrDj0twwAaDxWXdaub qfFE+LtoLYeivj2Loj3qbGLCDxT9oa0+zc6Lekg1xRnp4sgc3S1utFjEbmz7UtYE9Pul6pBuRDs/B kLrsj0DEibPa9pMAIQNHarfhQbeVkwexNP2JBII5K3LmO8GOe3FyWDK/9A4HqNuHCCYSaFDd5EYHt vtLZxpr3slwZlW3g+8HQN2NZDL5uqRclVDdhqSAtGgtHJeZ7virYtuzWtiEHLQ9u4oX/aMhPlnFob nLIrK/ry8CqVnNbubA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1u8jhG-00E44n-1d; Sat, 26 Apr 2025 17:52:14 +0000 From: linux@treblig.org To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-doc@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 1/5] regulator: devres: Remove unused devm_regulator_bulk_register_supply_alias Date: Sat, 26 Apr 2025 18:51:39 +0100 Message-ID: <20250426175143.128086-2-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250426175143.128086-1-linux@treblig.org> References: <20250426175143.128086-1-linux@treblig.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" From: "Dr. David Alan Gilbert" devm_regulator_bulk_register_supply_alias() has been unused since 2014's commit d137be00ee01 ("mfd: core: Don't use devres functions before device is added") Remove it, and the static helpers only it used. Signed-off-by: Dr. David Alan Gilbert --- .../driver-api/driver-model/devres.rst | 1 - drivers/regulator/devres.c | 74 ------------------- include/linux/regulator/consumer.h | 6 -- 3 files changed, 81 deletions(-) diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentati= on/driver-api/driver-model/devres.rst index d75728eb05f8..9a0122fceabd 100644 --- a/Documentation/driver-api/driver-model/devres.rst +++ b/Documentation/driver-api/driver-model/devres.rst @@ -424,7 +424,6 @@ PWM devm_fwnode_pwm_get() =20 REGULATOR - devm_regulator_bulk_register_supply_alias() devm_regulator_bulk_get() devm_regulator_bulk_get_const() devm_regulator_bulk_get_enable() diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c index 2cf03042fddf..3fb01417fa5a 100644 --- a/drivers/regulator/devres.c +++ b/drivers/regulator/devres.c @@ -490,15 +490,6 @@ struct regulator_supply_alias_match { const char *id; }; =20 -static int devm_regulator_match_supply_alias(struct device *dev, void *res, - void *data) -{ - struct regulator_supply_alias_match *match =3D res; - struct regulator_supply_alias_match *target =3D data; - - return match->dev =3D=3D target->dev && strcmp(match->id, target->id) =3D= =3D 0; -} - static void devm_regulator_destroy_supply_alias(struct device *dev, void *= res) { struct regulator_supply_alias_match *match =3D res; @@ -547,71 +538,6 @@ int devm_regulator_register_supply_alias(struct device= *dev, const char *id, } EXPORT_SYMBOL_GPL(devm_regulator_register_supply_alias); =20 -static void devm_regulator_unregister_supply_alias(struct device *dev, - const char *id) -{ - struct regulator_supply_alias_match match; - int rc; - - match.dev =3D dev; - match.id =3D id; - - rc =3D devres_release(dev, devm_regulator_destroy_supply_alias, - devm_regulator_match_supply_alias, &match); - if (rc !=3D 0) - WARN_ON(rc); -} - -/** - * devm_regulator_bulk_register_supply_alias - Managed register - * multiple aliases - * - * @dev: device to supply - * @id: list of supply names or regulator IDs - * @alias_dev: device that should be used to lookup the supply - * @alias_id: list of supply names or regulator IDs that should be used to - * lookup the supply - * @num_id: number of aliases to register - * - * @return 0 on success, a negative error number on failure. - * - * This helper function allows drivers to register several supply - * aliases in one operation, the aliases will be automatically - * unregisters when the source device is unbound. If any of the - * aliases cannot be registered any aliases that were registered - * will be removed before returning to the caller. - */ -int devm_regulator_bulk_register_supply_alias(struct device *dev, - const char *const *id, - struct device *alias_dev, - const char *const *alias_id, - int num_id) -{ - int i; - int ret; - - for (i =3D 0; i < num_id; ++i) { - ret =3D devm_regulator_register_supply_alias(dev, id[i], - alias_dev, - alias_id[i]); - if (ret < 0) - goto err; - } - - return 0; - -err: - dev_err(dev, - "Failed to create supply alias %s,%s -> %s,%s\n", - id[i], dev_name(dev), alias_id[i], dev_name(alias_dev)); - - while (--i >=3D 0) - devm_regulator_unregister_supply_alias(dev, id[i]); - - return ret; -} -EXPORT_SYMBOL_GPL(devm_regulator_bulk_register_supply_alias); - struct regulator_notifier_match { struct regulator *regulator; struct notifier_block *nb; diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index 56fe2693d9b2..1e20c7330cd4 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -185,12 +185,6 @@ int devm_regulator_register_supply_alias(struct device= *dev, const char *id, struct device *alias_dev, const char *alias_id); =20 -int devm_regulator_bulk_register_supply_alias(struct device *dev, - const char *const *id, - struct device *alias_dev, - const char *const *alias_id, - int num_id); - /* regulator output control and status */ int __must_check regulator_enable(struct regulator *regulator); int regulator_disable(struct regulator *regulator); --=20 2.49.0 From nobody Wed Feb 11 07:07:31 2026 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B1571DE883; Sat, 26 Apr 2025 17:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689947; cv=none; b=siVvjcKjKSfhG7LkmsaUK2tNgkePXUL1u8Us5tVjQa4e4TNHuRs2rke4wV+L1oBAf1ZrER8xuA2hq54XfL7XV8zteIQ3KCdc1O+q996ZCIEMjXAdzck20HKvRHKVyzgzweudouDSRqf1GF6dnDP0/IFmlrHBFeD7wfTbiI9cAYo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689947; c=relaxed/simple; bh=/uh2f4BTN14XsIz3+Nr7E4au5x2/32t2+an01LvJun4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RUbZ2BPzusribIpWy8aanHnHB/tBOxcL9v2Fsnjc9tfxBEYS5oYElxv+dXIzFrDp3rcBZyJOJ5lR5uIolusIo+WxiM/LmU5NAAM1YyJTSUeQEDVRFJXltambgYshFHdzblL1BvD2AX8u/2/aEZ/bzIxkKSo2QVyQZLyFFXX5UF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=XOTd83cc; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="XOTd83cc" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=/o189ne/jQPGYgD8OUPO8z1q2TFdEwQ0I6J22Cp9OBY=; b=XOTd83ccw1btb6QK Bq4TZoXSQGpP+XSRzoAlI6OQwXA4lA8ZtRQvbFcfmVUGWNzLKSa+/Qsj/AMIbG0un5UtxvpWGBV90 dIorF6SR17LBjCZXQXFAHXb4xRk9zHfB1ySJ4eZlPB4iHjucWTDOAFtwRfC9jYX6QvcyI/cjI57Pp 9XGevhqBJhRTIixikvdkv8L1OE+NWs1boIalWKvAmroK1bomG5iLqhVKHpBh2YajN0OmRyRkOSp0X EcjNLY0tdLppRJdSPcyvjf5xjFbxjxlDM9jFTanqKaVpKenLHVpTATRs6ooAUzNsr9pe+T86ArBMl UVyXMlVoQcafSxYwJA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1u8jhN-00E44n-06; Sat, 26 Apr 2025 17:52:21 +0000 From: linux@treblig.org To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-doc@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 2/5] regulator: core: Remove unused regulator_bulk_force_disable Date: Sat, 26 Apr 2025 18:51:40 +0100 Message-ID: <20250426175143.128086-3-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250426175143.128086-1-linux@treblig.org> References: <20250426175143.128086-1-linux@treblig.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" From: "Dr. David Alan Gilbert" regulator_bulk_force_disable() was explicitly added in 2012 by commit e1de2f423462 ("regulator: add regulator_bulk_force_disable function") but hasn't been used. Remove it. Signed-off-by: Dr. David Alan Gilbert --- drivers/regulator/core.c | 34 ------------------------------ include/linux/regulator/consumer.h | 8 ------- 2 files changed, 42 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 90629a756693..32e3919e37d2 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -5196,40 +5196,6 @@ int regulator_bulk_disable(int num_consumers, } EXPORT_SYMBOL_GPL(regulator_bulk_disable); =20 -/** - * regulator_bulk_force_disable - force disable multiple regulator consume= rs - * - * @num_consumers: Number of consumers - * @consumers: Consumer data; clients are stored here. - * - * This convenience API allows consumers to forcibly disable multiple regu= lator - * clients in a single API call. - * NOTE: This should be used for situations when device damage will - * likely occur if the regulators are not disabled (e.g. over temp). - * Although regulator_force_disable function call for some consumers can - * return error numbers, the function is called for all consumers. - * - * Return: 0 on success or a negative error number on failure. - */ -int regulator_bulk_force_disable(int num_consumers, - struct regulator_bulk_data *consumers) -{ - int i; - int ret =3D 0; - - for (i =3D 0; i < num_consumers; i++) { - consumers[i].ret =3D - regulator_force_disable(consumers[i].consumer); - - /* Store first error for reporting */ - if (consumers[i].ret && !ret) - ret =3D consumers[i].ret; - } - - return ret; -} -EXPORT_SYMBOL_GPL(regulator_bulk_force_disable); - /** * regulator_bulk_free - free multiple regulator consumers * diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index 1e20c7330cd4..999eba865c20 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -209,8 +209,6 @@ int devm_regulator_bulk_get_enable(struct device *dev, = int num_consumers, const char * const *id); int regulator_bulk_disable(int num_consumers, struct regulator_bulk_data *consumers); -int regulator_bulk_force_disable(int num_consumers, - struct regulator_bulk_data *consumers); void regulator_bulk_free(int num_consumers, struct regulator_bulk_data *consumers); =20 @@ -470,12 +468,6 @@ static inline int regulator_bulk_disable(int num_consu= mers, return 0; } =20 -static inline int regulator_bulk_force_disable(int num_consumers, - struct regulator_bulk_data *consumers) -{ - return 0; -} - static inline void regulator_bulk_free(int num_consumers, struct regulator_bulk_data *consumers) { --=20 2.49.0 From nobody Wed Feb 11 07:07:31 2026 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E942C25E44B; Sat, 26 Apr 2025 17:52:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689951; cv=none; b=mF//9XnuUUuTTh+X1MvctBP4Vdj3xpkCYjgNQL8z0tPfnhk0TbfxSUgcJZ9qBcxV+KtoHao4ZtbZ+qjPLFcwOeV1mr6VRvaJuAMhaOwvoJpW8Ols7gCYLe4JEqmWiuTy86H7tIaIV2DWbbTdkxBZh9Po7epeYaZ27LT6nEm5DYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689951; c=relaxed/simple; bh=NAt10LZBeqEWHfZdM5eVz5PYKVVcgF6L19KxgNYKQ5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cFA0J8UvewSynWnPviyTaC4r25tSEpSSST2o7DN5MyyVmXJ8fsTYAJGWiUXmAEKRqg9uFZ/HktA0s2Nqst50YjpQggVl1CrkdbegMwztmJOmEBCd/732aea+XZ5D8KbSS/jxbyWqwl1wRUrwukPvuFj9kdpzcxWyppwlO265jHc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=IC3EpR6c; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="IC3EpR6c" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=hoQcdVh4NTeufFeA4Okoft80aRjA9PYTz59tnqkdNKk=; b=IC3EpR6co+J+FAVF DD4X8ia3/bZQ0wFu0pPJX1EDme9q7MaVdVBsq+VdfgNVzSPmUE1d+dNTQF2qTuxEW1jlDqErhFzdx gCJcGF1B6vUvNQQEmR/GfjRPhBObHUGd8Kth3L4SN2zLrtLxFhtLqSxcHq0I7CuaGEebQbBDeOz7S hxsLZPN32KC/GbGDAUv++DjiekESrqs5gIVJqVKVPNV5eMOhFHblS/ZUspef6mh0lL/IAFhWz/RyD 8Y9BOiqxr8iWapD+XLuRtkDNhRnk99A82Mu84Ao+bRIS4Uvz3sunO4gtMUAePkk89GfeY8lgloHsX FQaI6bCL5jrG9l/mGg==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1u8jhS-00E44n-0L; Sat, 26 Apr 2025 17:52:26 +0000 From: linux@treblig.org To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-doc@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 3/5] regulator: core: Remove unused regulator_*drvdata functions Date: Sat, 26 Apr 2025 18:51:41 +0100 Message-ID: <20250426175143.128086-4-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250426175143.128086-1-linux@treblig.org> References: <20250426175143.128086-1-linux@treblig.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" From: "Dr. David Alan Gilbert" regulator_get_init_drvdata() was added in 2008 by the commit a5766f11cfd3 ("regulator: core - Rework machine API to remove string based functions.") regulator_set_drvdata() was also added in 2008 by the commit 414c70cb91c4 ("regulator: regulator framework core") neither have been used since, Remove them. Signed-off-by: Dr. David Alan Gilbert --- drivers/regulator/core.c | 17 ----------------- include/linux/regulator/consumer.h | 6 ------ include/linux/regulator/driver.h | 1 - 3 files changed, 24 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 32e3919e37d2..60c72d77f77a 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -6096,17 +6096,6 @@ void *regulator_get_drvdata(struct regulator *regula= tor) } EXPORT_SYMBOL_GPL(regulator_get_drvdata); =20 -/** - * regulator_set_drvdata - set regulator driver data - * @regulator: regulator - * @data: data - */ -void regulator_set_drvdata(struct regulator *regulator, void *data) -{ - regulator->rdev->reg_data =3D data; -} -EXPORT_SYMBOL_GPL(regulator_set_drvdata); - /** * rdev_get_id - get regulator ID * @rdev: regulator @@ -6131,12 +6120,6 @@ struct regmap *rdev_get_regmap(struct regulator_dev = *rdev) } EXPORT_SYMBOL_GPL(rdev_get_regmap); =20 -void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data) -{ - return reg_init_data->driver_data; -} -EXPORT_SYMBOL_GPL(regulator_get_init_drvdata); - #ifdef CONFIG_DEBUG_FS static int supply_map_show(struct seq_file *sf, void *data) { diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index 999eba865c20..0e9275079e17 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -267,7 +267,6 @@ int regulator_set_suspend_voltage(struct regulator *reg= ulator, int min_uV, =20 /* driver data - core doesn't touch */ void *regulator_get_drvdata(struct regulator *regulator); -void regulator_set_drvdata(struct regulator *regulator, void *data); =20 /* misc helpers */ =20 @@ -633,11 +632,6 @@ static inline void *regulator_get_drvdata(struct regul= ator *regulator) return NULL; } =20 -static inline void regulator_set_drvdata(struct regulator *regulator, - void *data) -{ -} - static inline int regulator_count_voltages(struct regulator *regulator) { return 0; diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/dri= ver.h index 4a216fdba354..e849bab379f2 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -765,7 +765,6 @@ int regulator_set_active_discharge_regmap(struct regula= tor_dev *rdev, int regulator_set_current_limit_regmap(struct regulator_dev *rdev, int min_uA, int max_uA); int regulator_get_current_limit_regmap(struct regulator_dev *rdev); -void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data= ); int regulator_find_closest_bigger(unsigned int target, const unsigned int = *table, unsigned int num_sel, unsigned int *sel); int regulator_set_ramp_delay_regmap(struct regulator_dev *rdev, int ramp_d= elay); --=20 2.49.0 From nobody Wed Feb 11 07:07:31 2026 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 102FC25EF82; Sat, 26 Apr 2025 17:52:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689957; cv=none; b=XpTZRW/6s/Fbi2WxKOtZCp4t5fup1G6nigCjZ//p4n9zkUJzTkaYdvEgnpfRHf1zBA463oq4kBIWtCiQROYYVfhgxqzHPIKK2MV1RPIf3A0P/IYiQlNn0t4jq7GxHF+0xrt6EaK+XHebjhlv5gm1KNcLiVD+X4B+uAyQiBDUg7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689957; c=relaxed/simple; bh=xbtbngHvOCi4Ro+jEiyoc4Stf5WoaqvLmDrAcxQpY3s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b9LadtPq10a1laJyLF56khJAAUAwE5izfhXFMviz6d/07ADYNUQp96NNsj97FvRnvmyzbvVef5k1e/T3By/v0VLRNtGt3QiY1zGqWUwAuK9gNKoc3gPYiN++4MIiGXZ9N5IoPI1e5SQMaXTuKX0hMxdV51tbBmSeQqkw4Mx2BC8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=Xnb2z96M; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="Xnb2z96M" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=hLe/NEDwH1YdpkKS3VuvEd3SqsKOowWSgbtWazS7OU4=; b=Xnb2z96MHV7lH/So dVTIPj0V1S0meyZVi1uO1YzWKSLy5mrELOU0JEpuwX9wE5zXo7MWGT9NWvnvJCZSNR8clbdxRcvST WR/IsLjS6G72w5nGI+joSIpnX15YiDm87OPeu5/9MlBV8B4wg/rIfVNuhQSonUR2t4z06Jp5eyZCU Srzjq2ZPn7tPex4yoGaB/5GQDDFEp4h5PhEdjCVih4p/lMrfxN0xwzcZ/Idpy0bT08soxdLlW6eaR eNRTOUnka1/BpnqLHa+BvfeEyRW12ddAWgyPBd8Uyi/zrePI8QmNhiI6j7hslVOqya7dbA5dFsmZD qp3zezJ/rOgge4wlzA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1u8jhY-00E44n-0p; Sat, 26 Apr 2025 17:52:32 +0000 From: linux@treblig.org To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-doc@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 4/5] regulator: core: Remove unused regulator_suspend_(disable|enable) Date: Sat, 26 Apr 2025 18:51:42 +0100 Message-ID: <20250426175143.128086-5-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250426175143.128086-1-linux@treblig.org> References: <20250426175143.128086-1-linux@treblig.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" From: "Dr. David Alan Gilbert" regulator_suspend_disable() and regulator_suspend_enable() were added by 2018's commit f7efad10b5c4 ("regulator: add PM suspend and resume hooks") but have remained unused. Remove them and their helper function regulator_suspend_toggle(). Signed-off-by: Dr. David Alan Gilbert --- drivers/regulator/core.c | 44 ------------------------------ include/linux/regulator/consumer.h | 16 ----------- 2 files changed, 60 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 60c72d77f77a..90449f387b98 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4244,50 +4244,6 @@ int regulator_set_voltage(struct regulator *regulato= r, int min_uV, int max_uV) } EXPORT_SYMBOL_GPL(regulator_set_voltage); =20 -static inline int regulator_suspend_toggle(struct regulator_dev *rdev, - suspend_state_t state, bool en) -{ - struct regulator_state *rstate; - - rstate =3D regulator_get_suspend_state(rdev, state); - if (rstate =3D=3D NULL) - return -EINVAL; - - if (!rstate->changeable) - return -EPERM; - - rstate->enabled =3D (en) ? ENABLE_IN_SUSPEND : DISABLE_IN_SUSPEND; - - return 0; -} - -int regulator_suspend_enable(struct regulator_dev *rdev, - suspend_state_t state) -{ - return regulator_suspend_toggle(rdev, state, true); -} -EXPORT_SYMBOL_GPL(regulator_suspend_enable); - -int regulator_suspend_disable(struct regulator_dev *rdev, - suspend_state_t state) -{ - struct regulator *regulator; - struct regulator_voltage *voltage; - - /* - * if any consumer wants this regulator device keeping on in - * suspend states, don't set it as disabled. - */ - list_for_each_entry(regulator, &rdev->consumer_list, list) { - voltage =3D ®ulator->voltage[state]; - if (voltage->min_uV || voltage->max_uV) - return 0; - } - - return regulator_suspend_toggle(rdev, state, false); -} -EXPORT_SYMBOL_GPL(regulator_suspend_disable); - static int _regulator_set_suspend_voltage(struct regulator *regulator, int min_uV, int max_uV, suspend_state_t state) diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index 0e9275079e17..a5479de53906 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -258,10 +258,6 @@ void devm_regulator_unregister_notifier(struct regulat= or *regulator, struct notifier_block *nb); =20 /* regulator suspend */ -int regulator_suspend_enable(struct regulator_dev *rdev, - suspend_state_t state); -int regulator_suspend_disable(struct regulator_dev *rdev, - suspend_state_t state); int regulator_set_suspend_voltage(struct regulator *regulator, int min_uV, int max_uV, suspend_state_t state); =20 @@ -608,18 +604,6 @@ static inline int devm_regulator_unregister_notifier(s= truct regulator *regulator return 0; } =20 -static inline int regulator_suspend_enable(struct regulator_dev *rdev, - suspend_state_t state) -{ - return -EINVAL; -} - -static inline int regulator_suspend_disable(struct regulator_dev *rdev, - suspend_state_t state) -{ - return -EINVAL; -} - static inline int regulator_set_suspend_voltage(struct regulator *regulato= r, int min_uV, int max_uV, suspend_state_t state) --=20 2.49.0 From nobody Wed Feb 11 07:07:31 2026 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C91CC25DD1B; Sat, 26 Apr 2025 17:52:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689967; cv=none; b=U3cQDMtnxb1LMr/8GEMtkz4cNDLjE1LXd4h3XmkNLDpLPyu2uOpf9lpb9P0r3O4Hg1K1UzBr+CJ6f08X9BybYVKMcYB+bwTDrSslQlo5JLLeTwaS+EL4hoNc7cxBSKqUNyFcy1rqRQNsFSklm1JEo4O+x4h3/90Nlx2BgfZT2mU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745689967; c=relaxed/simple; bh=8w+rNR6eu8fY+v+RULFbSJzlXnJopNHfRtWnyLB7khA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J+Kigylfa2EmT+KR+3N7G2mITo4hdIe8DNaduBWCX00Mjb00elr40WnJd5gwRFUKR/p9Fx1l4XvNyGEC0d8/E/btZbh5AuZuqmfBN4mnE9nAumQUUeSxGje9Z0EKF6l4rcsU2QQzonweydeO9izKZp282E8n5mWJBbjOeVJPVJQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=VsB/dk91; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="VsB/dk91" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=RMpr1kjjVDMlujzzN7oLiP/WXryaePyGDqrdliHt/k4=; b=VsB/dk91gxtcR663 du6HypK+wTqplfOslMFi+1Xw+loPFzKehTVFd+pmrrcWtgMYaLUQT9ab+RPk6kWGJ4BEALGeUBVU7 AwWSt7aLTKw9nHGWXp6ClgaFH1/4wnEcGRiDyAl0EOy0w0yF3t7X/WHCx/CrmHVydmpq5D7smcd2l e4sZ+JT/j2Rr2GCbzUQ/EehwYdPy3BYsf6k8CF5dTqRv/VNREdzCtOzZTFIfxSw7tz1XW/Jx7mNXf sFXfgsJiB6IBjH3plkIIEfkNtzaC8aPQbR22mTVO6L0lui3lvT2GLds1jVRXHuBW/mcJMQCngR6jB xfTME92v2KPLTeRTbg==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1u8jhg-00E44n-2S; Sat, 26 Apr 2025 17:52:40 +0000 From: linux@treblig.org To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-doc@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 5/5] regulator: core: Remove unused regulator_set_suspend_voltage Date: Sat, 26 Apr 2025 18:51:43 +0100 Message-ID: <20250426175143.128086-6-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250426175143.128086-1-linux@treblig.org> References: <20250426175143.128086-1-linux@treblig.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" From: "Dr. David Alan Gilbert" regulator_set_suspend_voltage() was added as part of 2018's commit f7efad10b5c4 ("regulator: add PM suspend and resume hooks") but is unused. Remove it, and the helpers it's the only user of. Signed-off-by: Dr. David Alan Gilbert --- drivers/regulator/core.c | 46 ------------------------------ include/linux/regulator/consumer.h | 11 ------- 2 files changed, 57 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 90449f387b98..a0d740a565a6 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -446,12 +446,6 @@ int regulator_check_voltage(struct regulator_dev *rdev, return 0; } =20 -/* return 0 if the state is valid */ -static int regulator_check_states(suspend_state_t state) -{ - return (state > PM_SUSPEND_MAX || state =3D=3D PM_SUSPEND_TO_IDLE); -} - /* Make sure we select a voltage that suits the needs of all * regulator consumers */ @@ -4244,46 +4238,6 @@ int regulator_set_voltage(struct regulator *regulato= r, int min_uV, int max_uV) } EXPORT_SYMBOL_GPL(regulator_set_voltage); =20 -static int _regulator_set_suspend_voltage(struct regulator *regulator, - int min_uV, int max_uV, - suspend_state_t state) -{ - struct regulator_dev *rdev =3D regulator->rdev; - struct regulator_state *rstate; - - rstate =3D regulator_get_suspend_state(rdev, state); - if (rstate =3D=3D NULL) - return -EINVAL; - - if (rstate->min_uV =3D=3D rstate->max_uV) { - rdev_err(rdev, "The suspend voltage can't be changed!\n"); - return -EPERM; - } - - return regulator_set_voltage_unlocked(regulator, min_uV, max_uV, state); -} - -int regulator_set_suspend_voltage(struct regulator *regulator, int min_uV, - int max_uV, suspend_state_t state) -{ - struct ww_acquire_ctx ww_ctx; - int ret; - - /* PM_SUSPEND_ON is handled by regulator_set_voltage() */ - if (regulator_check_states(state) || state =3D=3D PM_SUSPEND_ON) - return -EINVAL; - - regulator_lock_dependent(regulator->rdev, &ww_ctx); - - ret =3D _regulator_set_suspend_voltage(regulator, min_uV, - max_uV, state); - - regulator_unlock_dependent(regulator->rdev, &ww_ctx); - - return ret; -} -EXPORT_SYMBOL_GPL(regulator_set_suspend_voltage); - /** * regulator_set_voltage_time - get raise/fall time * @regulator: regulator source diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index a5479de53906..3383a6de58d1 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -257,10 +257,6 @@ int regulator_unregister_notifier(struct regulator *re= gulator, void devm_regulator_unregister_notifier(struct regulator *regulator, struct notifier_block *nb); =20 -/* regulator suspend */ -int regulator_set_suspend_voltage(struct regulator *regulator, int min_uV, - int max_uV, suspend_state_t state); - /* driver data - core doesn't touch */ void *regulator_get_drvdata(struct regulator *regulator); =20 @@ -604,13 +600,6 @@ static inline int devm_regulator_unregister_notifier(s= truct regulator *regulator return 0; } =20 -static inline int regulator_set_suspend_voltage(struct regulator *regulato= r, - int min_uV, int max_uV, - suspend_state_t state) -{ - return -EINVAL; -} - static inline void *regulator_get_drvdata(struct regulator *regulator) { return NULL; --=20 2.49.0