سؤال

this is a printer:

add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usb/lp0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usb/lp0
SUBSYSTEM=usb
MAJOR=180
MINOR=0
DEVNAME=usb/lp0
SEQNUM=1858
E=7/1/2
MODALIAS=usb:v03F0pB511d0100dc00dsc00dp00ic07isc01ip02
SEQNUM=1856

received 276 bytes

why no DEVTYPE ?

other device have it.

I needed it!

هل كانت مفيدة؟

المحلول

Fix it by myself.

diff --git a/kernel/drivers/usb/class/usblp.c b/kernel/drivers/usb/cl  
index 9eca405..b528437 100755  
--- a/kernel/drivers/usb/class/usblp.c  
+++ b/kernel/drivers/usb/class/usblp.c  
@@ -1046,8 +1046,13 @@ static const struct file_operations usblp_fops  
        .llseek =       noop_llseek,  
 };  

+static struct device_type printer_type = {  
+       .name   = "printer",  
+};  
+  
 static char *usblp_devnode(struct device *dev, mode_t *mode)  
 {  
+       dev->type=&printer_type;  
        return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));  
 }  
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top