On 03/31/2014 11:14 AM, Michael Trimarchi wrote:
Hi
Il 31/mar/2014 19:05 "Stephen Warren" <swarren@wwwdotorg.org mailto:swarren@wwwdotorg.org> ha scritto:
From: Stephen Warren <swarren@nvidia.com mailto:swarren@nvidia.com>
Add a device tree match table. This serves to make the driver's support of device tree more explicit. Perhaps the fallback for DT matching to using the i2c_device_id table will go away one day, since it fails in face of devices from different vendors with the same name.
Signed-off-by: Stephen Warren <swarren@nvidia.com
sound/soc/codecs/rt5640.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index b5014a2024e2..b6a02c16f100 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -2018,6 +2018,14 @@ static const struct i2c_device_id
rt5640_i2c_id[] = {
}; MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id);
+#if defined(CONFIG_OF) +static const struct of_device_id rt5640_of_match[] = {
{ .compatible = "realtek,rt5640", },
{},
+}; +MODULE_DEVICE_TABLE(of, rt5640_of_match); +#endif
Are you sure that you need #if defined?
It may not be necessary, but it's for consistency with the ACPI table which is also #defined.