X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=scripts%2Fmod%2Ffile2alias.c;h=e614ef689eee1f16dc19daf1c00be4460a184f63;hb=b7b045a55065647768ca11203d42029114c0dc80;hp=1924990a737f36c61820bd35470c9adf90f49888;hpb=a292241cccb7e20e8b997a9a44177e7c98141859;p=firefly-linux-kernel-4.4.55.git 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); static int do_of_entry (const char *filename, void *symval, char *alias) { - int len; - char *tmp; - DEF_FIELD_ADDR(symval, of_device_id, name); - DEF_FIELD_ADDR(symval, of_device_id, type); - DEF_FIELD_ADDR(symval, of_device_id, compatible); - - len = sprintf (alias, "of:N%sT%s", - (*name)[0] ? *name : "*", - (*type)[0] ? *type : "*"); - - if (compatible[0]) - sprintf (&alias[len], "%sC%s", - (*type)[0] ? "*" : "", - *compatible); - - /* Replace all whitespace with underscores */ - for (tmp = alias; tmp && *tmp; tmp++) - if (isspace (*tmp)) - *tmp = '_'; - - add_wildcard(alias); - return 1; + int len; + char *tmp; + DEF_FIELD_ADDR(symval, of_device_id, name); + DEF_FIELD_ADDR(symval, of_device_id, type); + DEF_FIELD_ADDR(symval, of_device_id, compatible); + + len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*", + (*type)[0] ? *type : "*"); + + if (compatible[0]) + sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "", + *compatible); + + /* Replace all whitespace with underscores */ + for (tmp = alias; tmp && *tmp; tmp++) + if (isspace (*tmp)) + *tmp = '_'; + + add_wildcard(alias); + return 1; } ADD_TO_DEVTABLE("of", of_device_id, do_of_entry);