Re: Kernel panic while calling device_add

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

 



On Sun, Nov 18, 2007 at 12:50:48AM +0800, vichy wrote:
> Dear all:
> I modified the lddbus sample bus driver in ldd3 as the attach file.
> 1. I add bus, ldd_bus_type, in ldd_bus.
> 2. I add device_driver, ldd_bus_driver, in ldd_bus.
> 3. then call device_register(&ldd_bus)
> The module can been successfully compiled, but the kernel panic will
> show while insert the module.
> (the kernel is dead totally such that I cannot attach the kernel log
> file. BTW, will someone tell me how to dump this kind of log?)
> 
> I even try device_add(&ldd_bus), as I marked in the source code but it
> still fail.
> This inspiration comes from usb-host contrller driver.
> ( The usb hub device is allocated and initialized the bus and
> device_driver by usb_alloc_dev located at core/usb.c.
> Then it call device_add (&udev->dev) at usb_new_device located at core/hub.c)
> 
> Could someone tell me where it goes wrong?

Lots of things have changed in the driver core since that file was written.

What kernel version are you trying to build this sample bus driver for?

If needed, I could probably fix it up to work on the latest kernel
version, I guess it would be a good idea just to document this mess...

Are you wanting to write your own bus driver code?  Or just trying to
understand the interactions of the bus code in the kernel?

thanks,

greg k-h

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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