On Thu, Mar 19, 2009 at 7:32 PM, Daniel Ng <daniel.ng1...@gmail.com> wrote: > > So, I tried to call spidev_probe() directly from the probe() function > of my SPI Controller driver. However in this case spidev_probe() > failed because its call to device_create_drvdata() failed with error > code ENODEV. Why would this be? > > This is how I make the call from my SPI Controller driver: > > spidev_probe(to_spi_device(&ofdev->dev)); > > And this is the relevant code in spidev_probe(): > > dev = device_create_drvdata(spidev_class, &spi->dev, spidev->devt, > spidev, "spidev%d.%d", > /*spi->master->bus_num*/0, spi->chip_select);
It looks like spidev_class was uninitialised because spidev_init() had not yet been called. To force spidev_init() to be called before my SPI Controller's driver initialisation, I just used: subsys_initcall(spidev_init); This seems to do the job... _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev