LinuxQuestions.org
Review your favorite Linux distribution.
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-30-2014, 09:05 PM   #1
david_8274
Member
 
Registered: Jun 2013
Location: California
Distribution: Ubuntu, Fedora
Posts: 75

Rep: Reputation: Disabled
Can two devices have the same major and minor number?


Hi,

I have created two devices /dev/rtc0 and /dev/rtc1. Just for fun I let them have the same major AND minor number, and they seem to work fine. As I understand the minor number should be different for two different devices using the same driver. Am I mistaken?

Thanks,
Wei
 
Old 04-30-2014, 09:12 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
You're not mistaken but what you may find is that you are only accessing one of the devices not both.
 
Old 04-30-2014, 09:15 PM   #3
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,412

Rep: Reputation: Disabled
A device node is just a pointer to a kernel resource with a certain major and minor number. The major/minor combination decides which device you end up accessing, not the name of the device node.

You can have any number of device nodes pointing to the same device.
 
  


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
Identify and explain the major number, minor number, and revision number in Linux... turbomen Linux - Newbie 1 11-16-2010 03:48 AM
why there is a need for minor number and major number for monitor/keyboard in pc? tripathi Solaris / OpenSolaris 1 11-07-2003 10:36 AM
usb mouse major/minor number raven Linux - Hardware 6 12-07-2002 07:19 AM
major/minor number zyan Linux - Newbie 2 06-25-2001 07:57 PM
major /minor number zyan Linux - General 0 06-22-2001 03:26 AM


All times are GMT -5. The time now is 02:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration