diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/platform.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index d2d4926c5c4c..f2377f3d95e5 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -1245,19 +1245,20 @@ static int __init early_platform_driver_probe_id(char *class_str, | |||
1245 | * rest of the driver core is initialized. | 1245 | * rest of the driver core is initialized. |
1246 | */ | 1246 | */ |
1247 | if (!match->dev.init_name) { | 1247 | if (!match->dev.init_name) { |
1248 | char buf[32]; | ||
1249 | |||
1250 | if (match->id != -1) | 1248 | if (match->id != -1) |
1251 | snprintf(buf, sizeof(buf), "%s.%d", | 1249 | match->dev.init_name = |
1252 | match->name, match->id); | 1250 | kasprintf(GFP_KERNEL, "%s.%d", |
1251 | match->name, | ||
1252 | match->id); | ||
1253 | else | 1253 | else |
1254 | snprintf(buf, sizeof(buf), "%s", | 1254 | match->dev.init_name = |
1255 | match->name); | 1255 | kasprintf(GFP_KERNEL, "%s", |
1256 | match->name); | ||
1256 | 1257 | ||
1257 | match->dev.init_name = kstrdup(buf, GFP_KERNEL); | ||
1258 | if (!match->dev.init_name) | 1258 | if (!match->dev.init_name) |
1259 | return -ENOMEM; | 1259 | return -ENOMEM; |
1260 | } | 1260 | } |
1261 | |||
1261 | if (epdrv->pdrv->probe(match)) | 1262 | if (epdrv->pdrv->probe(match)) |
1262 | pr_warning("%s: unable to probe %s early.\n", | 1263 | pr_warning("%s: unable to probe %s early.\n", |
1263 | class_str, match->name); | 1264 | class_str, match->name); |