From: Peter Korsgaard Date: Tue, 23 Sep 2008 20:01:27 +0000 (+0200) Subject: Driver core: make bus_find_device_by_name() more robust X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3ce24d8d93f8f9617841d0c8416174da7ee1b042;p=openwrt%2Fstaging%2Fblogic.git Driver core: make bus_find_device_by_name() more robust Use sysfs_streq() in bus_find_device_by_name() so trailing newlines are ignored (E.G. in bind/unbind). Signed-off-by: Peter Korsgaard Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/bus.c b/drivers/base/bus.c index ef522ae55480..39b9b58c6974 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -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); } /**