* [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning from device name
@ 2010-08-03 6:26 Jarkko Nikula
2010-08-03 6:26 ` [PATCH 2/2] ASoC: multi-component - Fix ".-1" removal " Jarkko Nikula
2010-08-03 13:51 ` [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning " Liam Girdwood
0 siblings, 2 replies; 3+ messages in thread
From: Jarkko Nikula @ 2010-08-03 6:26 UTC (permalink / raw)
To: alsa-devel; +Cc: Mark Brown, Liam Girdwood
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] ASoC: multi-component - Fix ".-1" removal from device name
2010-08-03 6:26 [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning from device name Jarkko Nikula
@ 2010-08-03 6:26 ` Jarkko Nikula
2010-08-03 13:51 ` [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning " Liam Girdwood
1 sibling, 0 replies; 3+ messages in thread
From: Jarkko Nikula @ 2010-08-03 6:26 UTC (permalink / raw)
To: alsa-devel; +Cc: Mark Brown, Liam Girdwood
Function fmt_single_name returns empty name if device name is
"driver-name.-1".
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. Do we even have a case where name is "foo-bar.-1"?
---
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 300a9b3..db7ea1b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2807,7 +2807,7 @@ static inline char *fmt_single_name(struct device *dev, int *id)
/* discard ID from name if ID == -1 */
if (*id == -1)
- *found = '\0';
+ found[strlen(dev->driver->name)] = '\0';
}
} else {
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning from device name
2010-08-03 6:26 [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning from device name Jarkko Nikula
2010-08-03 6:26 ` [PATCH 2/2] ASoC: multi-component - Fix ".-1" removal " Jarkko Nikula
@ 2010-08-03 13:51 ` Liam Girdwood
1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2010-08-03 13:51 UTC (permalink / raw)
To: Jarkko Nikula; +Cc: alsa-devel, Mark Brown
On Tue, 2010-08-03 at 09:26 +0300, Jarkko Nikula wrote:
> 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.
> ---
Thanks
Both Applied.
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-03 13:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-03 6:26 [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning from device name Jarkko Nikula
2010-08-03 6:26 ` [PATCH 2/2] ASoC: multi-component - Fix ".-1" removal " Jarkko Nikula
2010-08-03 13:51 ` [PATCH 1/2] ASoC: multi-component - Fix DAI ID scanning " Liam Girdwood
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).