]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Driver core: make bus_find_device_by_name() more robust
authorPeter Korsgaard <jacmet@sunsite.dk>
Tue, 23 Sep 2008 20:01:27 +0000 (22:01 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 16 Oct 2008 16:24:51 +0000 (09:24 -0700)
Use sysfs_streq() in bus_find_device_by_name() so trailing newlines
are ignored (E.G. in bind/unbind).

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/bus.c

index ef522ae5548092f83ddabcbf36d7a54ad56f7282..39b9b58c6974c72c75e8d2a5293a4ab3adc13819 100644 (file)
@@ -333,9 +333,7 @@ static int match_name(struct device *dev, void *data)
 {
        const char *name = data;
 
-       if (strcmp(name, dev->bus_id) == 0)
-               return 1;
-       return 0;
+       return sysfs_streq(name, dev->bus_id);
 }
 
 /**