]> www.infradead.org Git - users/willy/linux.git/commit
ASoC: codecs: lpass-rx-macro: Keep static regmap_config as const
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 1 Jul 2024 07:39:35 +0000 (09:39 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 3 Jul 2024 20:43:39 +0000 (21:43 +0100)
commit0c02cacf62fd90bf9f0c6c33e9a4862cfc50aab4
treeadd372a0425c6365d153887f683417667602faf8
parentee5e13b2c92324938c2bffc44b36b5a29fc28087
ASoC: codecs: lpass-rx-macro: Keep static regmap_config as const

The driver has static 'struct regmap_config', which is then customized
depending on device version.  This works fine, because there should not
be two devices in a system simultaneously and even less likely that such
two devices would have different versions, thus different regmap config.
However code is cleaner and more obvious when static data in the driver
is also const - it serves as a template.

Mark the 'struct regmap_config' as const and duplicate it in the probe()
with kmemdup to allow customizing per detected device variant.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240701-b4-qcom-audio-lpass-codec-cleanups-v3-3-6d98d4dd1ef5@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/lpass-rx-macro.c