aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 4fa954b07ac4..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}
444EXPORT_SYMBOL_GPL(platform_device_register_data);
444 445
445static int platform_drv_probe(struct device *_dev) 446static int platform_drv_probe(struct device *_dev)
446{ 447{
@@ -1000,7 +1001,7 @@ static __initdata LIST_HEAD(early_platform_device_list);
1000int __init early_platform_driver_register(struct early_platform_driver *epdrv, 1001int __init early_platform_driver_register(struct early_platform_driver *epdrv,
1001 char *buf) 1002 char *buf)
1002{ 1003{
1003 unsigned long index; 1004 char *tmp;
1004 int n; 1005 int n;
1005 1006
1006 /* Simply add the driver to the end of the global list. 1007 /* Simply add the driver to the end of the global list.
@@ -1019,13 +1020,28 @@ int __init early_platform_driver_register(struct early_platform_driver *epdrv,
1019 if (buf && !strncmp(buf, epdrv->pdrv->driver.name, n)) { 1020 if (buf && !strncmp(buf, epdrv->pdrv->driver.name, n)) {
1020 list_move(&epdrv->list, &early_platform_driver_list); 1021 list_move(&epdrv->list, &early_platform_driver_list);
1021 1022
1022 if (!strcmp(buf, epdrv->pdrv->driver.name)) 1023 /* Allow passing parameters after device name */
1024 if (buf[n] == '\0' || buf[n] == ',')
1023 epdrv->requested_id = -1; 1025 epdrv->requested_id = -1;
1024 else if (buf[n] == '.' && strict_strtoul(&buf[n + 1], 10, 1026 else {
1025 &index) == 0) 1027 epdrv->requested_id = simple_strtoul(&buf[n + 1],
1026 epdrv->requested_id = index; 1028 &tmp, 10);
1027 else 1029
1028 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 }
1029 } 1045 }
1030 1046
1031 return 0; 1047 return 0;