[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41840b750607300252w445974b1udedf1a67114d1580@mail.gmail.com>
Date: Sun, 30 Jul 2006 12:52:52 +0300
From: "Shem Multinymous" <multinymous@...il.com>
To: "Greg KH" <greg@...ah.com>
Cc: "Dmitry Torokhov" <dmitry.torokhov@...il.com>,
"Vojtech Pavlik" <vojtech@...e.cz>,
"Brown, Len" <len.brown@...el.com>, "Pavel Machek" <pavel@...e.cz>,
"Matthew Garrett" <mjg59@...f.ucam.org>,
"kernel list" <linux-kernel@...r.kernel.org>,
linux-thinkpad@...ux-thinkpad.org, linux-acpi@...r.kernel.org
Subject: Re: Generic battery interface
On 7/30/06, Greg KH <greg@...ah.com> wrote:
> > >Forgive my ignorance, but how do I conncet a sysfs directory with a /dev
> > >device?
> Just look at the "dev" file in sysfs, which shows the major:minor
> number.
Then to find the match for a given device node you need to enumerate /sys.
And to find a match for a given /sys device you need to enumerate
/dev, or some its subdirectories (/dev/{snd,input,...), or whatever
other random places people have decided to place their device nodes.
> Or just look at the directory that you are in, and that's almost always
> the /dev node name.
>
> For example, /sys/block/sda/sda1/ is /dev/sda1.
> /sys/class/tty/ttyS1 is /dev/ttyS1.
Yeah, and /sys/block/sr0 is /dev/scd0 (FC5 default udev rules).
> It's usually not that difficult to do the mapping :)
Hmm, "usually"...
Coming to think of it, to solve the dev->sys direction, maybe we
should have symlinks like the following?
/sys/dev/8/0 -> /sys/block/sda
/sys/dev/11/0 -> /sys/block/sr0
/sys/dev/116/24 -> /sys/class/sound/pcmC0D0c
Put otherwise:
Q:Quick, which io scheduler is used by /dev/scd0?
A: cat /sys/dev/$((0x`stat -c%t /dev/scd0`))/\
$((0x`stat -c%T /dev/scd0`))/queue/scheduler
(Please excuse the ugly hex to dec conversion.)
Shem
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists