OSDN Git Service

ARM: 8522/1: drivers: nvdimm: ensure no negative value gets returned on positive...
authorDan Williams <dan.j.williams@intel.com>
Mon, 15 Feb 2016 08:22:36 +0000 (09:22 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 16 Feb 2016 16:28:50 +0000 (16:28 +0000)
This patch ensures that existing bus match callbacks don't return
negative values (which might be interpreted as potential errors in the
future) in case of positive match.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/nvdimm/bus.c

index 7e2c43f..2b2181c 100644 (file)
@@ -62,7 +62,7 @@ static int nvdimm_bus_match(struct device *dev, struct device_driver *drv)
 {
        struct nd_device_driver *nd_drv = to_nd_device_driver(drv);
 
-       return test_bit(to_nd_device_type(dev), &nd_drv->type);
+       return !!test_bit(to_nd_device_type(dev), &nd_drv->type);
 }
 
 static struct module *to_bus_provider(struct device *dev)