On Fri, Sep 25, 2009 at 09:02:32PM -0500, Lopez Cruz, Misael wrote:

> +#if defined(CONFIG_SND_SOC_TWL6030)
> +#define twl_has_codec()      true
> +#else
> +#define twl_has_codec()      false
> +#endif

This ifdef won't match if the CODEC driver is modular.

> +
> +     if (twl_has_codec() && pdata->codec) {
> +             child = add_child(CODEC_SUB_CHIP_ID, "twl6030_codec",
> +                     pdata->codec, sizeof(*pdata->codec), false,
> +                     0, 0);
> +             if (IS_ERR(child))
> +                     return PTR_ERR(child);
> +     }

I'd be inclined to print a warning here if no platform data is supplied,
or have the CODEC handle missing platform data to make it easier for
people to diagnose any problems with instantiating the device.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to