Skip to content

Commit

Permalink
ASoC: WM8903: Add of_match_table
Browse files Browse the repository at this point in the history
This allows the device to be matched against the device tree using the
compatible flag directly, as is standard, rather than falling back to
matching .id_table against the non-vendor portion of the first compatible
property value.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Stephen Warren authored and Mark Brown committed Dec 7, 2011
1 parent 21abbb0 commit f18b4e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sound/soc/codecs/wm8903.c
Original file line number Diff line number Diff line change
Expand Up @@ -2201,6 +2201,12 @@ static __devexit int wm8903_i2c_remove(struct i2c_client *client)
return 0;
}

static const struct of_device_id wm8903_of_match[] = {
{ .compatible = "wlf,wm8903", },
{},
};
MODULE_DEVICE_TABLE(of, wm8903_of_match);

static const struct i2c_device_id wm8903_i2c_id[] = {
{ "wm8903", 0 },
{ }
Expand All @@ -2211,6 +2217,7 @@ static struct i2c_driver wm8903_i2c_driver = {
.driver = {
.name = "wm8903",
.owner = THIS_MODULE,
.of_match_table = wm8903_of_match,
},
.probe = wm8903_i2c_probe,
.remove = __devexit_p(wm8903_i2c_remove),
Expand Down

0 comments on commit f18b4e2

Please sign in to comment.