diff options
Diffstat (limited to 'sound/firewire/bebob/bebob_stream.c')
-rw-r--r-- | sound/firewire/bebob/bebob_stream.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index ef4d0c9f6578..1aab0a32870c 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c | |||
@@ -129,12 +129,24 @@ snd_bebob_stream_check_internal_clock(struct snd_bebob *bebob, bool *internal) | |||
129 | /* 1.The device has its own operation to switch source of clock */ | 129 | /* 1.The device has its own operation to switch source of clock */ |
130 | if (clk_spec) { | 130 | if (clk_spec) { |
131 | err = clk_spec->get(bebob, &id); | 131 | err = clk_spec->get(bebob, &id); |
132 | if (err < 0) | 132 | if (err < 0) { |
133 | dev_err(&bebob->unit->device, | 133 | dev_err(&bebob->unit->device, |
134 | "fail to get clock source: %d\n", err); | 134 | "fail to get clock source: %d\n", err); |
135 | else if (strncmp(clk_spec->labels[id], SND_BEBOB_CLOCK_INTERNAL, | 135 | goto end; |
136 | strlen(SND_BEBOB_CLOCK_INTERNAL)) == 0) | 136 | } |
137 | |||
138 | if (id >= clk_spec->num) { | ||
139 | dev_err(&bebob->unit->device, | ||
140 | "clock source %d out of range 0..%d\n", | ||
141 | id, clk_spec->num - 1); | ||
142 | err = -EIO; | ||
143 | goto end; | ||
144 | } | ||
145 | |||
146 | if (strncmp(clk_spec->labels[id], SND_BEBOB_CLOCK_INTERNAL, | ||
147 | strlen(SND_BEBOB_CLOCK_INTERNAL)) == 0) | ||
137 | *internal = true; | 148 | *internal = true; |
149 | |||
138 | goto end; | 150 | goto end; |
139 | } | 151 | } |
140 | 152 | ||