diff options
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r-- | scripts/mod/file2alias.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 1924990a737f..e614ef689eee 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -644,28 +644,26 @@ ADD_TO_DEVTABLE("pcmcia", pcmcia_device_id, do_pcmcia_entry); | |||
644 | 644 | ||
645 | static int do_of_entry (const char *filename, void *symval, char *alias) | 645 | static int do_of_entry (const char *filename, void *symval, char *alias) |
646 | { | 646 | { |
647 | int len; | 647 | int len; |
648 | char *tmp; | 648 | char *tmp; |
649 | DEF_FIELD_ADDR(symval, of_device_id, name); | 649 | DEF_FIELD_ADDR(symval, of_device_id, name); |
650 | DEF_FIELD_ADDR(symval, of_device_id, type); | 650 | DEF_FIELD_ADDR(symval, of_device_id, type); |
651 | DEF_FIELD_ADDR(symval, of_device_id, compatible); | 651 | DEF_FIELD_ADDR(symval, of_device_id, compatible); |
652 | 652 | ||
653 | len = sprintf (alias, "of:N%sT%s", | 653 | len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*", |
654 | (*name)[0] ? *name : "*", | 654 | (*type)[0] ? *type : "*"); |
655 | (*type)[0] ? *type : "*"); | 655 | |
656 | 656 | if (compatible[0]) | |
657 | if (compatible[0]) | 657 | sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "", |
658 | sprintf (&alias[len], "%sC%s", | 658 | *compatible); |
659 | (*type)[0] ? "*" : "", | 659 | |
660 | *compatible); | 660 | /* Replace all whitespace with underscores */ |
661 | 661 | for (tmp = alias; tmp && *tmp; tmp++) | |
662 | /* Replace all whitespace with underscores */ | 662 | if (isspace (*tmp)) |
663 | for (tmp = alias; tmp && *tmp; tmp++) | 663 | *tmp = '_'; |
664 | if (isspace (*tmp)) | 664 | |
665 | *tmp = '_'; | 665 | add_wildcard(alias); |
666 | 666 | return 1; | |
667 | add_wildcard(alias); | ||
668 | return 1; | ||
669 | } | 667 | } |
670 | ADD_TO_DEVTABLE("of", of_device_id, do_of_entry); | 668 | ADD_TO_DEVTABLE("of", of_device_id, do_of_entry); |
671 | 669 | ||