diff options
Diffstat (limited to 'drivers/base/platform.c')
| -rw-r--r-- | drivers/base/platform.c | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index ed156a13aa40..58efaf2f1259 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
| @@ -441,6 +441,7 @@ error: | |||
| 441 | platform_device_put(pdev); | 441 | platform_device_put(pdev); |
| 442 | return ERR_PTR(retval); | 442 | return ERR_PTR(retval); |
| 443 | } | 443 | } |
| 444 | EXPORT_SYMBOL_GPL(platform_device_register_data); | ||
| 444 | 445 | ||
| 445 | static int platform_drv_probe(struct device *_dev) | 446 | static int platform_drv_probe(struct device *_dev) |
| 446 | { | 447 | { |
| @@ -521,11 +522,15 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv, | |||
| 521 | { | 522 | { |
| 522 | int retval, code; | 523 | int retval, code; |
| 523 | 524 | ||
| 525 | /* make sure driver won't have bind/unbind attributes */ | ||
| 526 | drv->driver.suppress_bind_attrs = true; | ||
| 527 | |||
| 524 | /* temporary section violation during probe() */ | 528 | /* temporary section violation during probe() */ |
| 525 | drv->probe = probe; | 529 | drv->probe = probe; |
| 526 | retval = code = platform_driver_register(drv); | 530 | retval = code = platform_driver_register(drv); |
| 527 | 531 | ||
| 528 | /* Fixup that section violation, being paranoid about code scanning | 532 | /* |
| 533 | * Fixup that section violation, being paranoid about code scanning | ||
| 529 | * the list of drivers in order to probe new devices. Check to see | 534 | * the list of drivers in order to probe new devices. Check to see |
| 530 | * if the probe was successful, and make sure any forced probes of | 535 | * if the probe was successful, and make sure any forced probes of |
| 531 | * new devices fail. | 536 | * new devices fail. |
| @@ -996,7 +1001,7 @@ static __initdata LIST_HEAD(early_platform_device_list); | |||
| 996 | int __init early_platform_driver_register(struct early_platform_driver *epdrv, | 1001 | int __init early_platform_driver_register(struct early_platform_driver *epdrv, |
| 997 | char *buf) | 1002 | char *buf) |
| 998 | { | 1003 | { |
| 999 | unsigned long index; | 1004 | char *tmp; |
| 1000 | int n; | 1005 | int n; |
| 1001 | 1006 | ||
| 1002 | /* Simply add the driver to the end of the global list. | 1007 | /* Simply add the driver to the end of the global list. |
| @@ -1015,13 +1020,28 @@ int __init early_platform_driver_register(struct early_platform_driver *epdrv, | |||
| 1015 | if (buf && !strncmp(buf, epdrv->pdrv->driver.name, n)) { | 1020 | if (buf && !strncmp(buf, epdrv->pdrv->driver.name, n)) { |
| 1016 | list_move(&epdrv->list, &early_platform_driver_list); | 1021 | list_move(&epdrv->list, &early_platform_driver_list); |
| 1017 | 1022 | ||
| 1018 | if (!strcmp(buf, epdrv->pdrv->driver.name)) | 1023 | /* Allow passing parameters after device name */ |
| 1024 | if (buf[n] == '\0' || buf[n] == ',') | ||
| 1019 | epdrv->requested_id = -1; | 1025 | epdrv->requested_id = -1; |
| 1020 | else if (buf[n] == '.' && strict_strtoul(&buf[n + 1], 10, | 1026 | else { |
| 1021 | &index) == 0) | 1027 | epdrv->requested_id = simple_strtoul(&buf[n + 1], |
| 1022 | epdrv->requested_id = index; | 1028 | &tmp, 10); |
| 1023 | else | 1029 | |
| 1024 | epdrv->requested_id = EARLY_PLATFORM_ID_ERROR; | 1030 | if (buf[n] != '.' || (tmp == &buf[n + 1])) { |
| 1031 | epdrv->requested_id = EARLY_PLATFORM_ID_ERROR; | ||
| 1032 | n = 0; | ||
| 1033 | } else | ||
| 1034 | n += strcspn(&buf[n + 1], ",") + 1; | ||
| 1035 | } | ||
| 1036 | |||
| 1037 | if (buf[n] == ',') | ||
| 1038 | n++; | ||
| 1039 | |||
| 1040 | if (epdrv->bufsize) { | ||
| 1041 | memcpy(epdrv->buffer, &buf[n], | ||
| 1042 | min_t(int, epdrv->bufsize, strlen(&buf[n]) + 1)); | ||
| 1043 | epdrv->buffer[epdrv->bufsize - 1] = '\0'; | ||
| 1044 | } | ||
| 1025 | } | 1045 | } |
| 1026 | 1046 | ||
| 1027 | return 0; | 1047 | return 0; |
