public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Cc: hjk@linutronix.de, gregkh@suse.de,
	Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: Re: UIO device name
Date: Wed, 24 Sep 2008 19:14:39 +0900	[thread overview]
Message-ID: <20080924101439.GC7591@linux-sh.org> (raw)
In-Reply-To: <1222250279.12624.195.camel@gentoo-jocke.transmode.se>

On Wed, Sep 24, 2008 at 11:57:59AM +0200, Joakim Tjernlund wrote:
> On Wed, 2008-09-24 at 18:35 +0900, Paul Mundt wrote:
> > On Wed, Sep 24, 2008 at 11:21:33AM +0200, Joakim Tjernlund wrote:
> > > As far as I can see there isn't a way to name the /dev/uio%d device file
> > > to something more useful, is that so?
> > > I would like to name the device file from within the kernel so I can
> > > find the correct device from userspace.
> > > The very least is to control the minor(%d) number.
> > > 
> > You have a couple of options for this:
> > 
> > 	- the 'name' sysfs entry for each of the uio devices, which
> > 	  corresponds to the uio device name.
> > 	- extracting the relevant data from things like 'lsuio'.
> > 	- hooking in the pretty mame through udev to create an alias.
> 
> Right, but I want to do it from within the kernel when I create the
> device because that the only place I truly know what HW the uio maps to.
> 
> I found that this works:
>  struct uio_info *info,
>  struct uio_device *idev;
> 
>  idev = info->uio_dev;
>  device_rename(idev->dev, "irq4");
> 
> but then I have to copy the private uio_device struct from uio.c
> Is there a better way to get at idev->dev?
> 
I fail to see what this will buy you that you can't already do with udev
(or a set of scripts that look at sysfs) today. "the only place I truly
know what HW the uio maps to" doesn't make any sense, the name is fully
preserved and exposed. If you can't figure out your device from looking
at /sys/class/uio/uio?/name, I'm not sure how a rename is going to make
any difference.

If you need to poke at uio private data, you are almost certainly doing
something wrong.

  reply	other threads:[~2008-09-24 10:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24  9:21 UIO device name Joakim Tjernlund
2008-09-24  9:35 ` Paul Mundt
2008-09-24  9:57   ` Joakim Tjernlund
2008-09-24 10:14     ` Paul Mundt [this message]
2008-09-24 10:22     ` Hans J. Koch
2008-09-24 11:33       ` Joakim Tjernlund
2008-09-24 11:47         ` Paul Mundt
2008-09-24 12:38           ` Joakim Tjernlund
2008-09-24 22:57             ` Ben Nizette
2008-09-25 10:05               ` Joakim Tjernlund
2008-09-25 10:48                 ` Ben Nizette
2008-09-25 11:41                   ` Joakim Tjernlund
2008-09-25 11:53                     ` Paul Mundt
2008-09-25 12:36                       ` Joakim Tjernlund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080924101439.GC7591@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=gregkh@suse.de \
    --cc=hjk@linutronix.de \
    --cc=joakim.tjernlund@transmode.se \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox