On Mon, Dec 14, 2020 at 02:42:37PM +0800, Bard Liao wrote: > --- a/sound/soc/codecs/max98373.h > +++ b/sound/soc/codecs/max98373.h > @@ -203,6 +203,17 @@ > /* MAX98373_R2000_SW_RESET */ > #define MAX98373_SOFT_RESET (0x1 << 0) > > +struct max98373_cache { > + u32 reg; > + u32 val; > +}; > + > +struct max98373_cache max98373_cache[] = { > + {MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK, 0}, > + {MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK, 0}, > + {MAX98373_R20B6_BDE_CUR_STATE_READBACK, 0}, > +}; This is declaring a variable in the header, meaning there'll be one copy in each of the object files using the header and that if they get linked into a single object you should get warnings about duplicate symbols. It would be better to both allocate the version used at runtime dynamically (in case we somehow get multiple max98373s in a system) and have this list of registers be a static variable inside the driver code which is used to initialize that.
Attachment:
signature.asc
Description: PGP signature