LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-25-2016, 10:06 PM   #1
jjd3592
LQ Newbie
 
Registered: Feb 2016
Posts: 5

Rep: Reputation: Disabled
USB driver not registering the device


I'm running Ubuntu 14.04 LTS and I'm trying to write a basic usb driver. My init function is here:

Code:
static int __init usb_init(void)
{
	int ret = -1;
	printk(KERN_INFO "[*] Stick Driver constructor\n");
	printk(KERN_INFO "Registering Driver with Kernel");
	ret = usb_register(&usb_driver);
	
	printk(KERN_INFO "Driver is registered!\n");
	printk(KERN_INFO "Registration Complete");
	return ret;
}
Now here is the output of dmesg when I do a sudo insmod

Code:
Apr 25 23:00:35 jamesPC kernel: [14279.134566][*] Stick Driver constructor
Apr 25 23:00:35 jamesPC kernel: [14279.134568] Registering Driver with Kernel
Apr 25 23:00:35 jamesPC kernel: [14279.134602] usbcore: registered new interface driver Stick_Driver
Apr 25 23:00:35 jamesPC kernel: [14279.134603] Driver is registered!

Can anyone help explain why it doesn't output the second printk?? I originally had only the second printk, but just for the heck of it decided to add the first one, and it printed, to my confusion. If I remove any USB device from my computer, it will then print out the second printk in dmesg, but only if I remove a usb device. I don't know what is causing that, or maybe is that normal?
 
Old 04-26-2016, 07:34 AM   #2
c0d3d
Member
 
Registered: Aug 2012
Posts: 74

Rep: Reputation: 12
Have you checked the output of dmesg?
 
Old 04-26-2016, 10:05 AM   #3
jjd3592
LQ Newbie
 
Registered: Feb 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Sorry, I don't understand what you mean. I output dmesg in the post.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] USB device is not claimed by any active driver for every device in Linux 2.4 jacquesdirac Linux - Hardware 3 11-12-2010 08:35 AM
Question about usb storage device and device driver balteo Linux - Hardware 2 11-21-2009 09:37 AM
Bluetooth device not registering BallsOfSteel Linux - Hardware 6 05-10-2008 09:28 AM
device registering at boot justwantin Slackware 2 06-27-2007 05:00 PM
2.6 kernel device registering Michael_S Linux - Hardware 0 07-13-2006 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration