Re: simple question about struct pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 15, 2013 at 12:32 PM, Ben Wu <crayben@xxxxxxxx> wrote:

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??


static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
                 struct snd_pcm_hw_params *params,
                 struct snd_soc_dai *cpu_dai)
{
    struct s3c_i2sv2_info *i2s = snd_soc_dai_get_drvdata(cpu_dai);
    struct s3c_dma_params *dma_data;
    ....................................................................
}

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



Have a look at a utility binary "cdecl". This will help you greatly.  However, the statement above
means, snd_soc... is a function which takes a argument which is a pointer and returns a pointer
to struct s3c_..

Here the pointer i2s is declared and initialize. Else it will do nasty thing if you try to de-reference it.

Thanks,
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux