diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 18:24:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 18:24:56 -0500 |
commit | f58df54a54451c5feb2fdc4bc2f4fb12cf79be01 (patch) | |
tree | 930b5892717ce84de93508407ebc35757bbc5ea0 /drivers/base/platform.c | |
parent | 748e566b7e24541e05e3e70be311887a1262f2a1 (diff) | |
parent | 3589972e51fac1e02d0aaa576fa47f568cb94d40 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (27 commits)
Driver core: fix race in dev_driver_string
Driver Core: Early platform driver buffer
sysfs: sysfs_setattr remove unnecessary permission check.
sysfs: Factor out sysfs_rename from sysfs_rename_dir and sysfs_move_dir
sysfs: Propagate renames to the vfs on demand
sysfs: Gut sysfs_addrm_start and sysfs_addrm_finish
sysfs: In sysfs_chmod_file lazily propagate the mode change.
sysfs: Implement sysfs_getattr & sysfs_permission
sysfs: Nicely indent sysfs_symlink_inode_operations
sysfs: Update s_iattr on link and unlink.
sysfs: Fix locking and factor out sysfs_sd_setattr
sysfs: Simplify iattr time assignments
sysfs: Simplify sysfs_chmod_file semantics
sysfs: Use dentry_ops instead of directly playing with the dcache
sysfs: Rename sysfs_d_iput to sysfs_dentry_iput
sysfs: Update sysfs_setxattr so it updates secdata under the sysfs_mutex
debugfs: fix create mutex racy fops and private data
Driver core: Don't remove kobjects in device_shutdown.
firmware_class: make request_firmware_nowait more useful
Driver-Core: devtmpfs - set root directory mode to 0755
...
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 4fa954b07ac4..9d2ee25deaf5 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -1000,7 +1000,7 @@ static __initdata LIST_HEAD(early_platform_device_list); | |||
1000 | int __init early_platform_driver_register(struct early_platform_driver *epdrv, | 1000 | int __init early_platform_driver_register(struct early_platform_driver *epdrv, |
1001 | char *buf) | 1001 | char *buf) |
1002 | { | 1002 | { |
1003 | unsigned long index; | 1003 | char *tmp; |
1004 | int n; | 1004 | int n; |
1005 | 1005 | ||
1006 | /* Simply add the driver to the end of the global list. | 1006 | /* Simply add the driver to the end of the global list. |
@@ -1019,13 +1019,28 @@ int __init early_platform_driver_register(struct early_platform_driver *epdrv, | |||
1019 | if (buf && !strncmp(buf, epdrv->pdrv->driver.name, n)) { | 1019 | if (buf && !strncmp(buf, epdrv->pdrv->driver.name, n)) { |
1020 | list_move(&epdrv->list, &early_platform_driver_list); | 1020 | list_move(&epdrv->list, &early_platform_driver_list); |
1021 | 1021 | ||
1022 | if (!strcmp(buf, epdrv->pdrv->driver.name)) | 1022 | /* Allow passing parameters after device name */ |
1023 | if (buf[n] == '\0' || buf[n] == ',') | ||
1023 | epdrv->requested_id = -1; | 1024 | epdrv->requested_id = -1; |
1024 | else if (buf[n] == '.' && strict_strtoul(&buf[n + 1], 10, | 1025 | else { |
1025 | &index) == 0) | 1026 | epdrv->requested_id = simple_strtoul(&buf[n + 1], |
1026 | epdrv->requested_id = index; | 1027 | &tmp, 10); |
1027 | else | 1028 | |
1028 | epdrv->requested_id = EARLY_PLATFORM_ID_ERROR; | 1029 | if (buf[n] != '.' || (tmp == &buf[n + 1])) { |
1030 | epdrv->requested_id = EARLY_PLATFORM_ID_ERROR; | ||
1031 | n = 0; | ||
1032 | } else | ||
1033 | n += strcspn(&buf[n + 1], ",") + 1; | ||
1034 | } | ||
1035 | |||
1036 | if (buf[n] == ',') | ||
1037 | n++; | ||
1038 | |||
1039 | if (epdrv->bufsize) { | ||
1040 | memcpy(epdrv->buffer, &buf[n], | ||
1041 | min_t(int, epdrv->bufsize, strlen(&buf[n]) + 1)); | ||
1042 | epdrv->buffer[epdrv->bufsize - 1] = '\0'; | ||
1043 | } | ||
1029 | } | 1044 | } |
1030 | 1045 | ||
1031 | return 0; | 1046 | return 0; |