lkml.org 
[lkml]   [2006]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] [PNP] 'modalias' sysfs export
Here is a patch for doing multi line modalias for PNP devices. This will
break udev, so that needs to be updated first.

I had a longer look at the card part and it seems that module aliases
cannot be reliably used for it. Not without restructuring the system at
least. The possible combinations explode when you notice that the driver
ids needs to be just at subset of the card, without any ordering.

If I got my calculations right, a PNP card would have to have roughly
2^(2n) aliases, where n is the number of device ids. So right now, I
lean towards only adding modalias support for the non-card part of the
PNP layer.

Andrew, do you want a fix for the patch in -mm or can you remove the
part of it that modifies drivers/pnp/card.c by yourself?

Rgds
Pierre

[PNP] Export all aliases through the modalias attribute

From: Pierre Ossman <drzeus@drzeus.cx>

In order to be backwards compatible, we previously only exported the first
of all the PNP module aliases. We should instead export all aliases,
delimited by newlines.
---

drivers/pnp/interface.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index 67bd17c..8e78923 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -461,11 +461,15 @@ static DEVICE_ATTR(id,S_IRUGO,pnp_show_c

static ssize_t pnp_modalias_show(struct device *dmdev, struct device_attribute *attr, char *buf)
{
+ char *str = 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);
+ while (pos) {
+ str += sprintf(str,"pnp:d%s\n", pos->id);
+ pos = pos->next;
+ }
+ return (str - buf);
}

static DEVICE_ATTR(modalias,S_IRUGO,pnp_modalias_show,NULL);
\
 
 \ /
  Last update: 2006-03-11 17:07    [W:0.087 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site