diff options
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r-- | arch/powerpc/kernel/vio.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index cb22a3557c4e..19a5656001c0 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -317,30 +317,20 @@ static int vio_bus_match(struct device *dev, struct device_driver *drv) | |||
317 | return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL); | 317 | return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL); |
318 | } | 318 | } |
319 | 319 | ||
320 | static int vio_hotplug(struct device *dev, char **envp, int num_envp, | 320 | static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env) |
321 | char *buffer, int buffer_size) | ||
322 | { | 321 | { |
323 | const struct vio_dev *vio_dev = to_vio_dev(dev); | 322 | const struct vio_dev *vio_dev = to_vio_dev(dev); |
324 | struct device_node *dn; | 323 | struct device_node *dn; |
325 | const char *cp; | 324 | const char *cp; |
326 | int length; | ||
327 | |||
328 | if (!num_envp) | ||
329 | return -ENOMEM; | ||
330 | 325 | ||
331 | dn = dev->archdata.of_node; | 326 | dn = dev->archdata.of_node; |
332 | if (!dn) | 327 | if (!dn) |
333 | return -ENODEV; | 328 | return -ENODEV; |
334 | cp = of_get_property(dn, "compatible", &length); | 329 | cp = of_get_property(dn, "compatible", NULL); |
335 | if (!cp) | 330 | if (!cp) |
336 | return -ENODEV; | 331 | return -ENODEV; |
337 | 332 | ||
338 | envp[0] = buffer; | 333 | add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, cp); |
339 | length = scnprintf(buffer, buffer_size, "MODALIAS=vio:T%sS%s", | ||
340 | vio_dev->type, cp); | ||
341 | if ((buffer_size - length) <= 0) | ||
342 | return -ENOMEM; | ||
343 | envp[1] = NULL; | ||
344 | return 0; | 334 | return 0; |
345 | } | 335 | } |
346 | 336 | ||