Re: [patch 03/20] chardev: GPIO for SCx200: add a platform device so dev_dbg() works

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

 



Jesper Juhl wrote:
On 12/06/06, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:

Add a platform-device, then use it for dev_dbg(), once, just to prove it
works.

[snip]
+       /* should I export-gpl the pci-device available in scx200,
+          and use it instead of getting my own platform/isa device ?
+       */

I'd suggest finding that out and correct it before submitting for
inclusion instead of just leaving the question in a comment.


OK - Anyone ?   Pls consider, restated as:

dev_dbg() needs a dev,
one is available from struct platform_device *pdev;  pdev->dev,
another is in scx200.c:
- upon which scx200_gpio already depends.
could reach inside scx200.c for it,
- maybe too interconnected..

To complicate this further, theres patch 18/20,
which addresses the same problem, the same way, for the other driver.
The embedded issue is that the devp is needed by dev_dbg() in nsc_gpio.ko,
so that the common code can give useful user-support via its logging.


[snip]
+       // what about chrdev cleanup ?

Use C comments, please, not C++ comments.



old bad habit.
I now tend to use it partly to signal to reader that its not-for-inclusion.

Perhaps this new habit is also unhelpful, since it seems to draw attention,
.. you cant know that I know...

WRT the Q, is there anything to undo if init fails after cdev_init()s ?
LDD3 comment    /* Fail gracefully if need be */
suggests not, and I didnt see anything that fits this shutdown-ish behavior,
but I could have missed it.



continued thanks,
Jim Cromie

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