aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/file2alias.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index ed1244dd58d0..f646381dc015 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -353,11 +353,16 @@ static int do_pcmcia_entry(const char *filename,
353 353
354static int do_of_entry (const char *filename, struct of_device_id *of, char *alias) 354static int do_of_entry (const char *filename, struct of_device_id *of, char *alias)
355{ 355{
356 int len;
356 char *tmp; 357 char *tmp;
357 sprintf (alias, "of:N%sT%sC%s", 358 len = sprintf (alias, "of:N%sT%s",
358 of->name[0] ? of->name : "*", 359 of->name[0] ? of->name : "*",
359 of->type[0] ? of->type : "*", 360 of->type[0] ? of->type : "*");
360 of->compatible[0] ? of->compatible : "*"); 361
362 if (of->compatible[0])
363 sprintf (&alias[len], "%sC%s",
364 of->type[0] ? "*" : "",
365 of->compatible);
361 366
362 /* Replace all whitespace with underscores */ 367 /* Replace all whitespace with underscores */
363 for (tmp = alias; tmp && *tmp; tmp++) 368 for (tmp = alias; tmp && *tmp; tmp++)