static unsigned int aic26_reg_read(struct snd_soc_codec *codec,
                                   unsigned int reg)
 {
-       struct aic26 *aic26 = codec->private_data;
+       struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
        u16 *cache = codec->reg_cache;
        u16 cmd, value;
        u8 buffer[2];
 static int aic26_reg_write(struct snd_soc_codec *codec, unsigned int reg,
                           unsigned int value)
 {
-       struct aic26 *aic26 = codec->private_data;
+       struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
        u16 *cache = codec->reg_cache;
        u16 cmd;
        u8 buffer[4];
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->card->codec;
-       struct aic26 *aic26 = codec->private_data;
+       struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
        int fsref, divisor, wlen, pval, jval, dval, qval;
        u16 reg;
 
 static int aic26_mute(struct snd_soc_dai *dai, int mute)
 {
        struct snd_soc_codec *codec = dai->codec;
-       struct aic26 *aic26 = codec->private_data;
+       struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
        u16 reg = aic26_reg_read_cache(codec, AIC26_REG_DAC_GAIN);
 
        dev_dbg(&aic26->spi->dev, "aic26_mute(dai=%p, mute=%i)\n",
                            int clk_id, unsigned int freq, int dir)
 {
        struct snd_soc_codec *codec = codec_dai->codec;
-       struct aic26 *aic26 = codec->private_data;
+       struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
 
        dev_dbg(&aic26->spi->dev, "aic26_set_sysclk(dai=%p, clk_id==%i,"
                " freq=%i, dir=%i)\n",
 static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
 {
        struct snd_soc_codec *codec = codec_dai->codec;
-       struct aic26 *aic26 = codec->private_data;
+       struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
 
        dev_dbg(&aic26->spi->dev, "aic26_set_fmt(dai=%p, fmt==%i)\n",
                codec_dai, fmt);
        /* Setup what we can in the codec structure so that the register
         * access functions will work as expected.  More will be filled
         * out when it is probed by the SoC CODEC part of this driver */
-       aic26->codec.private_data = aic26;
+       snd_soc_codec_set_drvdata(&aic26->codec, aic26);
        aic26->codec.name = "aic26";
        aic26->codec.owner = THIS_MODULE;
        aic26->codec.dai = &aic26_dai;
 
                        struct snd_kcontrol *kcontrol, int event)
 {
        struct snd_soc_codec *codec = w->codec;
-       struct twl6040_data *priv = codec->private_data;
+       struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
 
        if (SND_SOC_DAPM_EVENT_ON(event))
                priv->non_lp++;
 static irqreturn_t twl6040_naudint_handler(int irq, void *data)
 {
        struct snd_soc_codec *codec = data;
-       struct twl6040_data *priv = codec->private_data;
+       struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
        u8 intid;
 
        twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid, TWL6040_REG_INTID);
 static int twl6040_power_up_completion(struct snd_soc_codec *codec,
                                        int naudint)
 {
-       struct twl6040_data *priv = codec->private_data;
+       struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
        int time_left;
        u8 intid;
 
 static int twl6040_set_bias_level(struct snd_soc_codec *codec,
                                enum snd_soc_bias_level level)
 {
-       struct twl6040_data *priv = codec->private_data;
+       struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
        int audpwron = priv->audpwron;
        int naudint = priv->naudint;
        int ret;
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->card->codec;
-       struct twl6040_data *priv = codec->private_data;
+       struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
 
        if (!priv->sysclk) {
                dev_err(codec->dev,
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->card->codec;
-       struct twl6040_data *priv = codec->private_data;
+       struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
        u8 lppllctl;
        int rate;
 
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->card->codec;
-       struct twl6040_data *priv = codec->private_data;
+       struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
 
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
                int clk_id, unsigned int freq, int dir)
 {
        struct snd_soc_codec *codec = codec_dai->codec;
-       struct twl6040_data *priv = codec->private_data;
+       struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
        u8 hppllctl, lppllctl;
 
        hppllctl = twl6040_read_reg_cache(codec, TWL6040_REG_HPPLLCTL);
        codec->read = twl6040_read_reg_cache;
        codec->write = twl6040_write;
        codec->set_bias_level = twl6040_set_bias_level;
-       codec->private_data = priv;
+       snd_soc_codec_set_drvdata(codec, priv);
        codec->dai = &twl6040_dai;
        codec->num_dai = 1;
        codec->reg_cache_size = ARRAY_SIZE(twl6040_reg);
 
 static int __devexit twl6040_codec_remove(struct platform_device *pdev)
 {
-       struct twl6040_data *priv = twl6040_codec->private_data;
+       struct twl6040_data *priv = snd_soc_codec_get_drvdata(twl6040_codec);
        int audpwron = priv->audpwron;
        int naudint = priv->naudint;