Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: cs42l51: re-hook of_match_table pointer

In commit a1253ef6d3fa ("ASoC: cs42l51: split i2c from codec driver"),
the I2C part of the CS42L51 was moved to a separate file, but the
definition of the of_device_id array was left in the driver file
itself, no longer connected to the platform_driver structure using the
.of_match_table pointer.

This commit exports the of_device_id array in cs42l51, and uses it as
.of_match_able in cs42l51-i2c.c. This solution was suggested by Brian
Austin.

Fixes: a1253ef6d3fa ("ASoC: cs42l51: split i2c from codec driver")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>

authored by

Thomas Petazzoni and committed by
Mark Brown
2cb1e025 f114040e

+5 -1
+1
sound/soc/codecs/cs42l51-i2c.c
··· 46 46 .driver = { 47 47 .name = "cs42l51", 48 48 .owner = THIS_MODULE, 49 + .of_match_table = cs42l51_of_match, 49 50 }, 50 51 .probe = cs42l51_i2c_probe, 51 52 .remove = cs42l51_i2c_remove,
+3 -1
sound/soc/codecs/cs42l51.c
··· 558 558 } 559 559 EXPORT_SYMBOL_GPL(cs42l51_probe); 560 560 561 - static const struct of_device_id cs42l51_of_match[] = { 561 + const struct of_device_id cs42l51_of_match[] = { 562 562 { .compatible = "cirrus,cs42l51", }, 563 563 { } 564 564 }; 565 565 MODULE_DEVICE_TABLE(of, cs42l51_of_match); 566 + EXPORT_SYMBOL_GPL(cs42l51_of_match); 567 + 566 568 MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); 567 569 MODULE_DESCRIPTION("Cirrus Logic CS42L51 ALSA SoC Codec Driver"); 568 570 MODULE_LICENSE("GPL");
+1
sound/soc/codecs/cs42l51.h
··· 22 22 23 23 extern const struct regmap_config cs42l51_regmap; 24 24 int cs42l51_probe(struct device *dev, struct regmap *regmap); 25 + extern const struct of_device_id cs42l51_of_match[]; 25 26 26 27 #define CS42L51_CHIP_ID 0x1B 27 28 #define CS42L51_CHIP_REV_A 0x00