Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 132058f7 authored by Vitaly Bordug's avatar Vitaly Bordug Committed by Paul Mackerras
Browse files

[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: default avatarVitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 49c28e4e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -156,12 +156,13 @@ void platform_notify_map(const struct platform_notify_dev_map *map,
	while (map->bus_id != NULL) {
		idx = -1;
		s = strrchr(dev->bus_id, '.');
		if (s != NULL)
		if (s != NULL) {
			idx = (int)simple_strtol(s + 1, NULL, 10);
		else
			s = dev->bus_id;

			len = s - dev->bus_id;
		} else {
			s = dev->bus_id;
			len = strlen(dev->bus_id);
		}

		if (!strncmp(dev->bus_id, map->bus_id, len)) {
			pdev = container_of(dev, struct platform_device, dev);