driver - Why does this device_create() call not create a /dev/ entry? -


I am porting the platform driver code to a PCIe version and I do not understand why I do not < Enter the code> / dev / entry The platform driver code has been modified:
  stable dev_t first; Stable structure class * square; ATTRIBUTE_GROUPS (my); Fixed int __init my_pci_init (zero) {int ret; Create a class entry in /Sysfs * / if ((class = class_create (THIS_MODULE, "test_driver")) == NULL {pr_err ("Structure class structure" could not be created.); Ret = -ENODEV; Goto exhaust; } Class-> dev_groups = my_groups; To ignore the return value of / * / / / *, create / dev / file system entry: 'Structure Device' is a 'Structure Class' for mapping / (if device (Square, Faucet, First, Faucet, KBUILIDMODAI) == faucet) {Pr_err ("Entry could not be created in '/ dev /' file system. '); Ret = -ENODEV; Goto exit;} else {pr_info (" Created / dev / entry. "); } If ((ret = pci_register_driver (and pci_driver))   

If the name of the module is 'cz_tdm'; my_pci_exit (;); pr_err ("ret =% d", ret);} Return return;} module_init (my_pci_init) So, I was hoping that the above code would make an entry / dev / cz_tdm at least when I was compiling it as a platform driver sysfs < / Code> shows that the driver was loaded and shows all the properties in sysfs .

/ Sys / devices / virtual /...// >> they Where do i expect them So he gives

What?

whoops

because it is also not considered. A highly enthusiastic extinction of code was removed from this essential element:

  / * Add four tools to the system. * / Cdev_init (& amp; cdev, & amp; fops); If ((ret = cdev_add (& amp; cdev; first, DEV_MINOR_NUMBER_COUNT)) & lt; 0) {pr_err ("Could not add system to system:% d", ret); Ret = -ENODEV; Goto exhaust; }    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -