* [PATCH] line6: add a check for snd_card_register
@ 2018-12-26 3:39 Kangjie Lu
2019-01-01 9:00 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Kangjie Lu @ 2018-12-26 3:39 UTC (permalink / raw)
To: kjlu; +Cc: pakki001, Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel
The fix checks if snd_card_register() fails, and if so, issues a
warning.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
sound/usb/line6/pod.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c
index 020c81818951..da8837bc5a5b 100644
--- a/sound/usb/line6/pod.c
+++ b/sound/usb/line6/pod.c
@@ -320,7 +320,8 @@ static void pod_startup4(struct work_struct *work)
line6_read_serial_number(&pod->line6, &pod->serial_number);
/* ALSA audio interface: */
- snd_card_register(line6->card);
+ if (snd_card_register(line6->card))
+ pr_warn("Failed to register ALSA card.\n");
}
/* POD special files: */
--
2.17.2 (Apple Git-113)
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] line6: add a check for snd_card_register
2018-12-26 3:39 [PATCH] line6: add a check for snd_card_register Kangjie Lu
@ 2019-01-01 9:00 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2019-01-01 9:00 UTC (permalink / raw)
To: Kangjie Lu; +Cc: alsa-devel, Jaroslav Kysela, pakki001, linux-kernel
On Wed, 26 Dec 2018 04:39:31 +0100,
Kangjie Lu wrote:
>
> The fix checks if snd_card_register() fails, and if so, issues a
> warning.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Hmm, you submitted multiple patches doing the similar things but the
error messages are handled completely differently in both cases.
Please make them consistent.
... and above all:
> - snd_card_register(line6->card);
> + if (snd_card_register(line6->card))
> + pr_warn("Failed to register ALSA card.\n");
This error message is almost useless. Better to use dev_*() variant.
thanks,
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-01 9:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-26 3:39 [PATCH] line6: add a check for snd_card_register Kangjie Lu
2019-01-01 9:00 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®