]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
umc-bus.c: fix usage of device_trylock
authorClaudio Scordino <claudio@evidence.eu.com>
Tue, 9 Oct 2012 10:21:17 +0000 (12:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Oct 2012 18:39:31 +0000 (11:39 -0700)
Fix usage of device_trylock. It has the same semantics of mutex_trylock, so it
returns 1 if the lock has been acquired successfully.

Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Signed-off-by: Bruno Morelli <bruno@evidence.eu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uwb/umc-bus.c

index 82a84d53120f27f2a1734fcef5ab5774d5fbc0a3..5c5b3fc9088a30d25fd526fca9427006e9f9d23e 100644 (file)
@@ -63,7 +63,7 @@ int umc_controller_reset(struct umc_dev *umc)
        struct device *parent = umc->dev.parent;
        int ret = 0;
 
-       if (device_trylock(parent))
+       if (!device_trylock(parent))
                return -EAGAIN;
        ret = device_for_each_child(parent, parent, umc_bus_pre_reset_helper);
        if (ret >= 0)