From: Jarkko Nikula <jhnikula@gmail.com>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@slimlogic.co.uk>
Subject: [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning from device name
Date: Tue, 3 Aug 2010 09:26:57 +0300 [thread overview]
Message-ID: <1280816818-10154-1-git-send-email-jhnikula@gmail.com> (raw)
Format string specifier ".%d" for sscanf cannot scan integer from a string
"driver-name.123". Fix this by starting the scan from a position after
"driver-name".
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
---
Liam. This is a trivial fix. No need for separate patch, just embed to your
next multi-component update. I noticed this because dai->id in mcbsp_dai_probe
was always zero.
---
sound/soc/soc-core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 5c10439..300a9b3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2803,7 +2803,7 @@ static inline char *fmt_single_name(struct device *dev, int *id)
found = strstr(name, dev->driver->name);
if (found) {
/* get ID */
- if (sscanf(found,".%d", id) == 1) {
+ if (sscanf(&found[strlen(dev->driver->name)], ".%d", id) == 1) {
/* discard ID from name if ID == -1 */
if (*id == -1)
--
1.7.1
next reply other threads:[~2010-08-03 6:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-03 6:26 Jarkko Nikula [this message]
2010-08-03 6:26 ` [PATCH 2/2] ASoC: multi-component - Fix ".-1" removal from device name Jarkko Nikula
2010-08-03 13:51 ` [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning " Liam Girdwood
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=1280816818-10154-1-git-send-email-jhnikula@gmail.com \
--to=jhnikula@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@slimlogic.co.uk \
/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;
as well as URLs for NNTP newsgroup(s).