Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1ab423502e787e264b4797a5fa200d804c4fd63
Commit:     d1ab423502e787e264b4797a5fa200d804c4fd63
Parent:     55b637c6a003a8c4850b41a2c2fd6942d8a7f530
Author:     Sylvain Munaut <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 19:59:29 2007 +1000
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Sat May 19 09:10:10 2007 +0200

    powerpc: Fix the MODALIAS generation in modpost for of devices
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
    Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
---
 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 ed1244d..f646381 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -353,11 +353,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++)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to