diff options
author | Thomas Petazzoni <thomas.petazzoni@bootlin.com> | 2023-07-13 13:21:12 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-07-17 07:15:09 +0200 |
commit | e51df4f81b02bcdd828a04de7c1eb6a92988b61e (patch) | |
tree | e3e21c7eba7cc164d309f276472718a69014d68d /lib/is_single_threaded.c | |
parent | ASoC: Merge v6.5-rc2 (diff) | |
download | linux-e51df4f81b02bcdd828a04de7c1eb6a92988b61e.tar.xz linux-e51df4f81b02bcdd828a04de7c1eb6a92988b61e.zip |
ASoC: cs42l51: fix driver to properly autoload with automatic module loading
In commit 2cb1e0259f50 ("ASoC: cs42l51: re-hook of_match_table
pointer"), 9 years ago, some random guy fixed the cs42l51 after it was
split into a core part and an I2C part to properly match based on a
Device Tree compatible string.
However, the fix in this commit is wrong: the MODULE_DEVICE_TABLE(of,
....) is in the core part of the driver, not the I2C part. Therefore,
automatic module loading based on module.alias, based on matching with
the DT compatible string, loads the core part of the driver, but not
the I2C part. And threfore, the i2c_driver is not registered, and the
codec is not known to the system, nor matched with a DT node with the
corresponding compatible string.
In order to fix that, we move the MODULE_DEVICE_TABLE(of, ...) into
the I2C part of the driver. The cs42l51_of_match[] array is also moved
as well, as it is not possible to have this definition in one file,
and the MODULE_DEVICE_TABLE(of, ...) invocation in another file, due
to how MODULE_DEVICE_TABLE works.
Thanks to this commit, the I2C part of the driver now properly
autoloads, and thanks to its dependency on the core part, the core
part gets autoloaded as well, resulting in a functional sound card
without having to manually load kernel modules.
Fixes: 2cb1e0259f50 ("ASoC: cs42l51: re-hook of_match_table pointer")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Link: https://lore.kernel.org/r/20230713112112.778576-1-thomas.petazzoni@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'lib/is_single_threaded.c')
0 files changed, 0 insertions, 0 deletions