ASoC: Make platform data optional for TLV320AIC3x
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 26 Aug 2009 12:05:14 +0000 (13:05 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 26 Aug 2009 14:27:56 +0000 (15:27 +0100)
Now that we don't need the I2C address for the device the platform data
is redundant so allow it to be omitted.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Chaithrika U S <chaithrika@ti.com>
sound/soc/codecs/tlv320aic3x.c

index 5d547675b853671bfbf1452ba3eac67ea6592c33..3395cf945d565b694dc1849a32027b48802c1e99 100644 (file)
@@ -1385,15 +1385,14 @@ static int aic3x_probe(struct platform_device *pdev)
        socdev->card->codec = codec;
        setup = socdev->codec_data;
 
-       if (!setup) {
-               dev_err(&pdev->dev, "No setup data supplied\n");
-               return -EINVAL;
+       if (setup) {
+               /* setup GPIO functions */
+               aic3x_write(codec, AIC3X_GPIO1_REG,
+                           (setup->gpio_func[0] & 0xf) << 4);
+               aic3x_write(codec, AIC3X_GPIO2_REG,
+                           (setup->gpio_func[1] & 0xf) << 4);
        }
 
-       /* setup GPIO functions */
-       aic3x_write(codec, AIC3X_GPIO1_REG, (setup->gpio_func[0] & 0xf) << 4);
-       aic3x_write(codec, AIC3X_GPIO2_REG, (setup->gpio_func[1] & 0xf) << 4);
-
        /* register pcms */
        ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
        if (ret < 0) {