aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/crypto')
-rw-r--r--drivers/s390/crypto/ap_bus.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index bf37cdf43fae..5aac0ec36368 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -423,27 +423,25 @@ static int ap_uevent (struct device *dev, char **envp, int num_envp,
423 char *buffer, int buffer_size) 423 char *buffer, int buffer_size)
424{ 424{
425 struct ap_device *ap_dev = to_ap_dev(dev); 425 struct ap_device *ap_dev = to_ap_dev(dev);
426 int length; 426 int retval = 0, length = 0, i = 0;
427 427
428 if (!ap_dev) 428 if (!ap_dev)
429 return -ENODEV; 429 return -ENODEV;
430 430
431 /* Set up DEV_TYPE environment variable. */ 431 /* Set up DEV_TYPE environment variable. */
432 envp[0] = buffer; 432 retval = add_uevent_var(envp, num_envp, &i,
433 length = scnprintf(buffer, buffer_size, "DEV_TYPE=%04X", 433 buffer, buffer_size, &length,
434 ap_dev->device_type); 434 "DEV_TYPE=%04X", ap_dev->device_type);
435 if (buffer_size - length <= 0) 435 if (retval)
436 return -ENOMEM; 436 return retval;
437 buffer += length; 437
438 buffer_size -= length;
439 /* Add MODALIAS= */ 438 /* Add MODALIAS= */
440 envp[1] = buffer; 439 retval = add_uevent_var(envp, num_envp, &i,
441 length = scnprintf(buffer, buffer_size, "MODALIAS=ap:t%02X", 440 buffer, buffer_size, &length,
442 ap_dev->device_type); 441 "MODALIAS=ap:t%02X", ap_dev->device_type);
443 if (buffer_size - length <= 0) 442
444 return -ENOMEM; 443 envp[i] = NULL;
445 envp[2] = NULL; 444 return retval;
446 return 0;
447} 445}
448 446
449static struct bus_type ap_bus_type = { 447static struct bus_type ap_bus_type = {