From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 5.15.y] ASoC: cs42l51: fix driver to properly autoload with automatic module loading
Date: Tue, 1 Aug 2023 10:15:56 +0200 [thread overview]
Message-ID: <20230801101556.21eed088@windsurf> (raw)
In-Reply-To: <2023080157-twitch-embargo-953b@gregkh>
Hello Greg,
On Tue, 1 Aug 2023 10:03:26 +0200
Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Jul 27, 2023 at 02:33:39PM +0200, Thomas Petazzoni wrote:
> > 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>
> > ---
> > sound/soc/codecs/cs42l51-i2c.c | 6 ++++++
> > sound/soc/codecs/cs42l51.c | 7 -------
> > sound/soc/codecs/cs42l51.h | 1 -
> > 3 files changed, 6 insertions(+), 8 deletions(-)
>
> What is the git commit id of this change in Linus's tree?
Ah, I see I didn't do "git cherry-pick -x
e51df4f81b02bcdd828a04de7c1eb6a92988b61e", so the commit log doesn't
have the reference to the original commit, sorry about this.
The original commit in Linus tree is:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e51df4f81b02bcdd828a04de7c1eb6a92988b61e
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
next prev parent reply other threads:[~2023-08-01 8:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-23 14:07 FAILED: patch "[PATCH] ASoC: cs42l51: fix driver to properly autoload with automatic" failed to apply to 5.15-stable tree gregkh
2023-07-27 12:33 ` [PATCH 5.15.y] ASoC: cs42l51: fix driver to properly autoload with automatic module loading Thomas Petazzoni
2023-08-01 8:03 ` Greg KH
2023-08-01 8:15 ` Thomas Petazzoni [this message]
2023-08-01 8:53 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230801101556.21eed088@windsurf \
--to=thomas.petazzoni@bootlin.com \
--cc=gregkh@linuxfoundation.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox