aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVitaly Bordug <vbordug@ru.mvista.com>2006-04-03 07:26:32 -0400
committerPaul Mackerras <paulus@samba.org>2006-04-13 12:30:19 -0400
commit132058f78a1bc8cce2c5a40245365938d51832fe (patch)
treef9bac73c83e10164a70e02c2360d3dd0815e5015 /arch
parent49c28e4e40be73019481f3c13a5966e0cc8f5a9d (diff)
[PATCH] ppc32: Fix string comparing in platform_notify_map
Fixed odd function behavior when dev->bus_id does not contain '.' - it compared that case 0 characters of the string and hereby reported success and executed callback. Now bus_id's are compared correctly, extra callback triggering eliminated. Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc/syslib/ppc_sys.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
index 60c724e11584..7662c4e6e7d6 100644
--- a/arch/ppc/syslib/ppc_sys.c
+++ b/arch/ppc/syslib/ppc_sys.c
@@ -156,12 +156,13 @@ void platform_notify_map(const struct platform_notify_dev_map *map,
156 while (map->bus_id != NULL) { 156 while (map->bus_id != NULL) {
157 idx = -1; 157 idx = -1;
158 s = strrchr(dev->bus_id, '.'); 158 s = strrchr(dev->bus_id, '.');
159 if (s != NULL) 159 if (s != NULL) {
160 idx = (int)simple_strtol(s + 1, NULL, 10); 160 idx = (int)simple_strtol(s + 1, NULL, 10);
161 else 161 len = s - dev->bus_id;
162 } else {
162 s = dev->bus_id; 163 s = dev->bus_id;
163 164 len = strlen(dev->bus_id);
164 len = s - dev->bus_id; 165 }
165 166
166 if (!strncmp(dev->bus_id, map->bus_id, len)) { 167 if (!strncmp(dev->bus_id, map->bus_id, len)) {
167 pdev = container_of(dev, struct platform_device, dev); 168 pdev = container_of(dev, struct platform_device, dev);