• Barry Song's avatar
    ASoC: move setting ac97 platformdata earlier than ac97 read/write · f7732053
    Barry Song authored
    While probing, AC97 codec drivers and soc-core generically execute the
    following sequence:
    snd_soc_new_ac97_codec -> snd_soc_new_pcms -> reset ac-link/read AC97 ID
    to detect ->...  -> set platform_data to ac97 by soc-core
    
    commit 474828a4 adds platform_data to
    snd_ac97 instance. But ac97 platform data hasn't given to snd_ac97
    before actual ac97 operations. Then while ac97_read access platform_data
    of snd_ac97 for detecting, NULL pointer oops will fire. That means old
    platform_data patch doesn't work in real-life cases.
    
    This patch moves the operation of setting ac97 platform_data earlier
    than ac97 reading/writing operations. Then it makes platform_data of
    AC97 become practically useful.
    Signed-off-by: default avatarBarry Song <21cnbao@gmail.com>
    Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
    Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
    f7732053
soc-core.c 67.7 KB