ASoC: fix clkdev API usage in sh/migor.c

The clkdev API doesn't use .name and .id members of struct clk for clock
lookup. Instead clocks should be added to a lookup list. Without this patch
audio om the Migo-R board fails silently.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by Guennadi Liakhovetski and committed by Mark Brown cbfa5184 708fafb3

+13 -2
+13 -2
sound/soc/sh/migor.c
··· 12 #include <linux/firmware.h> 13 #include <linux/module.h> 14 15 #include <asm/clock.h> 16 17 #include <cpu/sh7722.h> ··· 41 }; 42 43 static struct clk siumckb_clk = { 44 - .name = "siumckb_clk", 45 - .id = -1, 46 .ops = &siumckb_clk_ops, 47 .rate = 0, /* initialised at run-time */ 48 }; 49 50 static int migor_hw_params(struct snd_pcm_substream *substream, 51 struct snd_pcm_hw_params *params) ··· 181 if (ret < 0) 182 return ret; 183 184 /* Port number used on this machine: port B */ 185 migor_snd_device = platform_device_alloc("soc-audio", 1); 186 if (!migor_snd_device) { ··· 208 epdevadd: 209 platform_device_put(migor_snd_device); 210 epdevalloc: 211 clk_unregister(&siumckb_clk); 212 return ret; 213 } 214 215 static void __exit migor_exit(void) 216 { 217 clk_unregister(&siumckb_clk); 218 platform_device_unregister(migor_snd_device); 219 }
··· 12 #include <linux/firmware.h> 13 #include <linux/module.h> 14 15 + #include <asm/clkdev.h> 16 #include <asm/clock.h> 17 18 #include <cpu/sh7722.h> ··· 40 }; 41 42 static struct clk siumckb_clk = { 43 .ops = &siumckb_clk_ops, 44 .rate = 0, /* initialised at run-time */ 45 }; 46 + 47 + static struct clk_lookup *siumckb_lookup; 48 49 static int migor_hw_params(struct snd_pcm_substream *substream, 50 struct snd_pcm_hw_params *params) ··· 180 if (ret < 0) 181 return ret; 182 183 + siumckb_lookup = clkdev_alloc(&siumckb_clk, "siumckb_clk", NULL); 184 + if (!siumckb_lookup) { 185 + ret = -ENOMEM; 186 + goto eclkdevalloc; 187 + } 188 + clkdev_add(siumckb_lookup); 189 + 190 /* Port number used on this machine: port B */ 191 migor_snd_device = platform_device_alloc("soc-audio", 1); 192 if (!migor_snd_device) { ··· 200 epdevadd: 201 platform_device_put(migor_snd_device); 202 epdevalloc: 203 + clkdev_drop(siumckb_lookup); 204 + eclkdevalloc: 205 clk_unregister(&siumckb_clk); 206 return ret; 207 } 208 209 static void __exit migor_exit(void) 210 { 211 + clkdev_drop(siumckb_lookup); 212 clk_unregister(&siumckb_clk); 213 platform_device_unregister(migor_snd_device); 214 }