Re: dev_dbg etc with char drivers ?

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

 



On Tue, Jan 31, 2006 at 05:05:28PM -0700, Jim Cromie wrote:
> Jim Cromie wrote:
> >
> >im working on updating a drivers/char module to 2.6,
> >Ive got it working with cdevs, etc.
> >
> >Id like to convert the printk(KERN_* "foo") calls to use dev_dbg() and 
> >friends,
> >but I cannot see how to get a valid struct device for these char-devs.
> >
> >Am I missing something ?
> >
> 
> adding more details ..
> 
> module in question is scx200_gpio. It depends on scx200, which is
> a pci device, so I *could* get a struct device ref there, *but*
> thats not a general solution, and wont work for the other half
> of the work; ie a new pc8736x_gpio module, which operates the
> gpio unit on this Super-IO chip.

Those devices should be a platform_device, right?  You can get the
pointer from there.

All devices should have some backing struct device, it's just tough to
find out where it is at times :)

> Can one get from THIS_MODULE, a struct module, thru its
> struct module_kobject member, and its kobject, etc
> by using a sequence of container_of() macros ?

Woah, no, never use the struct module's kobject, that's not to be messed
around with.

> IOW, there doesnt seem to be any fixed module <-> device relationship
> that I can grok.

There is none.  So you aren't missing anything here.

thanks,

greg k-h

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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