mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: drzeus-list@drzeus.cx, ambx1@neo.rr.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [PNP] 'modalias' sysfs export
Date: Sun, 12 Mar 2006 14:55:43 -0800	[thread overview]
Message-ID: <20060312145543.194f4dc7.akpm@osdl.org> (raw)
In-Reply-To: <20060312172332.GA10278@vrfy.org>

Kay Sievers <kay.sievers@vrfy.org> wrote:
>
> On Sun, Mar 12, 2006 at 12:17:19PM +0100, Pierre Ossman wrote:
> > Andrew Morton wrote:
> > > I assume you mean that the drivers/pnp/card.c patch of
> > > pnp-modalias-sysfs-export.patch needs to be removed and this patch applies
> > > on top of the result.
> > >
> > > But I don't want to break udev.
> > >   
> > 
> > I suppose I wasn't entirely clear there. I'd like you to do the first
> > part (remove the card.c part), but not apply this second patch. I just
> > sent that in as a means of getting the ball rolling again.
> 
> Again, multiline sysfs modalias files are not going to happen. Find a
> sane way to encode the list of devices into a single string, or don't do
> it at all. And it must be available in the event environment too.
> 
> > The reason I'm pushing this issue is that Red Hat decided to drop all
> > magical scripts that figured out what modules to load and instead only
> > use the modalias attribute. They consider the right way to go is to get
> > the PNP layer to export modalias, so that's what I'm trying to do.
> 
> There is no need to rush out with this half-baken solution. This simple
> udev rule does the job for you, if you want pnp module autoloading with
> the current kernel:
>   SUBSYSTEM=="pnp", RUN+="/bin/sh -c 'while read id; do /sbin/modprobe pnp:d$$id; done < /sys$devpath/id'"
> 
> Andrew, please make sure, that this patch does not hit mainline until
> there is a _sane_ solution to the multiple id's exported for a single
> device problem.
> 

The only patch I presently have is:

--- devel/drivers/pnp/interface.c~pnp-modalias-sysfs-export	2006-03-12 03:27:01.000000000 -0800
+++ devel-akpm/drivers/pnp/interface.c	2006-03-12 03:27:01.000000000 -0800
@@ -459,10 +459,22 @@ static ssize_t pnp_show_current_ids(stru
 
 static DEVICE_ATTR(id,S_IRUGO,pnp_show_current_ids,NULL);
 
+static ssize_t pnp_modalias_show(struct device *dmdev, struct device_attribute *attr, char *buf)
+{
+	struct pnp_dev *dev = to_pnp_dev(dmdev);
+	struct pnp_id * pos = dev->id;
+
+	/* FIXME: modalias can only do one alias */
+	return sprintf(buf, "pnp:d%s\n", pos->id);
+}
+
+static DEVICE_ATTR(modalias,S_IRUGO,pnp_modalias_show,NULL);
+
 int pnp_interface_attach_device(struct pnp_dev *dev)
 {
 	device_create_file(&dev->dev,&dev_attr_options);
 	device_create_file(&dev->dev,&dev_attr_resources);
 	device_create_file(&dev->dev,&dev_attr_id);
+	device_create_file(&dev->dev,&dev_attr_modalias);
 	return 0;
 }
_

Is that OK?

  reply	other threads:[~2006-03-12 22:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-27 21:40 Pierre Ossman
2006-03-01 19:45 ` Kay Sievers
2006-03-02  8:39   ` Pierre Ossman
2006-03-02 16:58     ` Kay Sievers
2006-03-03 11:52       ` Pierre Ossman
2006-03-11 16:05         ` Pierre Ossman
2006-03-11 16:15           ` Arjan van de Ven
2006-03-11 16:21             ` Pierre Ossman
2006-03-12  1:38           ` Andrew Morton
2006-03-12  4:05             ` Kay Sievers
2006-03-12  4:29             ` Adam Belay
2006-03-12  5:09               ` Kay Sievers
2006-03-12  6:01                 ` Adam Belay
2006-03-12 11:17             ` Pierre Ossman
2006-03-12 11:33               ` Matthieu CASTET
2006-03-12 17:23               ` Kay Sievers
2006-03-12 22:55                 ` Andrew Morton [this message]
2006-03-13  4:14                   ` Kay Sievers
2006-03-13  6:02                     ` Adam Belay
2006-03-13  6:21                       ` Kay Sievers
2006-03-13  7:04                         ` Adam Belay
2006-03-13  7:26                         ` Adam Belay
2006-03-13  7:36                           ` Kay Sievers
2006-03-14  1:25                             ` Adam Belay
2006-03-13 16:57                 ` Bill Nottingham
2006-03-13 19:24                   ` Kay Sievers
2006-03-13 22:26                     ` Bill Nottingham
2006-03-14 12:29                       ` Sergey Vlasov
2006-03-14 12:47                         ` Pierre Ossman
2006-03-14 15:00                           ` Sergey Vlasov
2006-05-09 17:41                         ` Pozsar Balazs
2006-05-12 11:09                           ` Kay Sievers
2006-03-11 17:07 Andrey Borzenkov

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=20060312145543.194f4dc7.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=ambx1@neo.rr.com \
    --cc=drzeus-list@drzeus.cx \
    --cc=kay.sievers@vrfy.org \
    --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

Powered by JetHome