public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Sylvain Munaut <tnt@246tNt•com>
To: Paul Mackerras <paulus@samba•org>
Cc: PPC dev ML <linuxppc-dev@ozlabs•org>, Sylvain Munaut <tnt@246tNt•com>
Subject: [PATCH 1/8] powerpc: Fix the MODALIAS generation in modpost for of devices
Date: Sun,  6 May 2007 17:38:45 +0200	[thread overview]
Message-ID: <11784659351487-git-send-email-tnt@246tNt.com> (raw)
In-Reply-To: <11784659324066-git-send-email-tnt@246tNt.com>

Since the devices may have multiple (or none) compatible properties,
the uevent generated internally by the kernel may have multiple
"C..." entries. So the MODALIAS stored in the module must have
wilcard before and after the compatible entry.
Also, if the 'compatible' field is not used for matching, there
will be no 'C' and that must handled as well.

The previous code handled all those case incorrectly and it
"mostly" worked ... but not always.

Signed-off-by: Sylvain Munaut <tnt@246tNt•com>
---
 scripts/mod/file2alias.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index b2f73ff..4903292 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -354,11 +354,16 @@ static int do_pcmcia_entry(const char *filename,
 
 static int do_of_entry (const char *filename, struct of_device_id *of, char *alias)
 {
+    int len;
     char *tmp;
-    sprintf (alias, "of:N%sT%sC%s",
+    len = sprintf (alias, "of:N%sT%s",
                     of->name[0] ? of->name : "*",
-                    of->type[0] ? of->type : "*",
-                    of->compatible[0] ? of->compatible : "*");
+                    of->type[0] ? of->type : "*");
+
+    if (of->compatible[0])
+        sprintf (&alias[len], "%sC%s",
+                     of->type[0] ? "*" : "",
+                     of->compatible);
 
     /* Replace all whitespace with underscores */
     for (tmp = alias; tmp && *tmp; tmp++)
-- 
1.5.1.2

  reply	other threads:[~2007-05-06 15:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-06 15:38 macio modalias & mpc52xx related patches for 2.6.22 Sylvain Munaut
2007-05-06 15:38 ` Sylvain Munaut [this message]
2007-05-06 15:38   ` [PATCH 2/8] powerpc: export of_device_get_modalias Sylvain Munaut
2007-05-06 15:38     ` [PATCH 3/8] macintosh: Use common modalias generation for macio_sysfs Sylvain Munaut
2007-05-06 15:38       ` [PATCH 4/8] powerpc: lite5200(b) dts fixes Sylvain Munaut
2007-05-06 15:38         ` [PATCH 5/8] powerpc: lite5200(b) support for i2c Sylvain Munaut
2007-05-06 15:38           ` [PATCH 6/8] powerpc: Set efika's device_type to "soc" Sylvain Munaut
2007-05-06 15:38             ` [PATCH 7/8] serial/powerpc: Don't shutdown TX on mpc5200 serial port if it is a console Sylvain Munaut
2007-05-06 15:38               ` [PATCH 8/8] powerpc: mpc52xx suspend to deep-sleep Sylvain Munaut
2007-05-07  9:09   ` [PATCH 1/8] powerpc: Fix the MODALIAS generation in modpost for of devices Johannes Berg

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=11784659351487-git-send-email-tnt@246tNt.com \
    --to=tnt@246tnt$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=paulus@samba$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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