In the YOCTO/Linux source tree there's _drivers/spi/_ which has all the
source for SPI drivers. There's only 1 file, _spidev.c_, which has:
static int __init spidev_init(void)
{
       int status;

       /* Claim our 256 reserved device numbers.  Then register a class
        * that will key udev/mdev to add/remove /dev nodes.  Last,
register
        * the driver which manages those device numbers.
        */
       BUILD_BUG_ON(N_SPI_MINORS > 256);
       status = register_chrdev(SPIDEV_MAJOR, "spi", &spidev_fops);
       if (status < 0)
               return status;

       spidev_class = class_create(THIS_MODULE, "spidev");
       if (IS_ERR(spidev_class)) {
               unregister_chrdev(SPIDEV_MAJOR,
spidev_spi_driver.driver.name);
               return PTR_ERR(spidev_class);
       }

       status = spi_register_driver(&spidev_spi_driver);
       if (status < 0) {
               class_destroy(spidev_class);
               unregister_chrdev(SPIDEV_MAJOR,
spidev_spi_driver.driver.name);
       }
       return status;
}
module_init(spidev_init); ... for creating device files in _udev_.
So when I use '_make nconfig_' to specifiy that I want a loadable module
for the ALTERA SPI driver, why don't I see a _spidev.o_ file in
_drivers/spi/_ ?
How does _spi-altera.ko_ create device files without a call to
register_chrdev(...). How is it a loadable module without module_init(...)?
When I separately build _spidev.c_ as an _.ko_ and try loading it, I
get: "_Device or resourse busy_"
---John
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#52751): https://lists.yoctoproject.org/g/yocto/message/52751
Mute This Topic: https://lists.yoctoproject.org/mt/81407811/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to