]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
regulator: bd71828: rename IC specific entities
authorMatti Vaittinen <mazziesaccount@gmail.com>
Mon, 15 Dec 2025 13:19:53 +0000 (15:19 +0200)
committerLee Jones <lee@kernel.org>
Tue, 13 Jan 2026 12:49:35 +0000 (12:49 +0000)
commit8dc33b7c995e3e08087053b79cf919fba61e3669
treed6c3802ee0d323f0ae608f177ff6232b1ecd36de
parentaf25277b1ddc6c65879247387d127c38c51ba9f0
regulator: bd71828: rename IC specific entities

The new ROHM BD72720 PMIC has similarities with the BD71828. It makes
sense to support the regulator control for both PMICs using the same
driver. It is often more clear to have the IC specific functions and
globals named starting with the chip-name. So, as a preparatory step,
prefix the BD71828 specific functions and globals with the bd71828.

It would be tempting to try also removing the chip ID from those
functions which will be common for both PMICs. I have bad experiences on
this as it tends to lead to problems when yet another IC is being
supported with the same driver, and we will have some functions used for
all, some for two of the three, and some for just one. At this point
I used to start inventing wildcards like BD718XX or BD7272X. This
approach is pretty much always failing as we tend to eventually have
something like BD73900 - where all the wildcard stuff will break down.

So, my approach these days is to:
 - keep the original chip-id prefix for anything that had it already
   (and avoid the churn).
 - use same prefix for all things that are used by multiple ICs -
   typically the chip-ID of the first chip. This typically matches also
   the driver and file names.
 - use specific chip-ID as a prefix for anything which is specific to
   just one chip.

As a preparatory step to adding the BD72720, add bd71828 prefix to all
commonly usable functions and globals.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/df5c98c6392c3b52cd41e3d98d60b65a1585b2dd.1765804226.git.mazziesaccount@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/regulator/bd71828-regulator.c