<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 15, 2013 at 12:32 PM, Ben Wu <span dir="ltr"><<a href="mailto:crayben@yahoo.cn" target="_blank">crayben@yahoo.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top"><br>Dear All £¬Im new to linux kernel program, and found struct pointer is difficult to understand, that the struct s3c_i2sv2_info *i2s = snd_soc_dai_get_drvdata(cpu_dai) means,? why is use the struct pointer assgn another struct pointer??<br>
<br><br>static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,<br> struct snd_pcm_hw_params *params,<br> struct snd_soc_dai *cpu_dai)<br>{<br> struct s3c_i2sv2_info *i2s = snd_soc_dai_get_drvdata(cpu_dai);<br>
struct s3c_dma_params *dma_data;<br> ....................................................................<br>}</td></tr></tbody></table><br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br> <table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td valign="top"><br>Have a look at a utility binary "cdecl". This will help you greatly. However, the statement above<br>
means, snd_soc... is a function which takes a argument which is a pointer and returns a pointer <br>to struct s3c_..<br><br>Here the pointer i2s is declared and initialize. Else it will do nasty thing if you try to de-reference it.<br>
</td></tr></tbody></table><br></div><div class="gmail_extra">Thanks,<br></div></div>