[PATCH v3 21/27] gpib: ni_usb: Fix the *allocate_private retval check

Dominik Karol Piątkowski posted 27 patches 3 weeks, 3 days ago
[PATCH v3 21/27] gpib: ni_usb: Fix the *allocate_private retval check
Posted by Dominik Karol Piątkowski 3 weeks, 3 days ago
Change

if (retval < 0)
        return retval;

into

if (retval)
        return retval;

as it is more fitting in this case.

Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---

v3:
- Change `(retval < 0)` to `(retval)`

 drivers/gpib/ni_usb/ni_usb_gpib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpib/ni_usb/ni_usb_gpib.c b/drivers/gpib/ni_usb/ni_usb_gpib.c
index 1fc3ccdebff1..2b7aca9e5a33 100644
--- a/drivers/gpib/ni_usb/ni_usb_gpib.c
+++ b/drivers/gpib/ni_usb/ni_usb_gpib.c
@@ -2232,7 +2232,7 @@ static int ni_usb_attach(struct gpib_board *board, const struct gpib_board_confi
 
 	mutex_lock(&ni_usb_hotplug_lock);
 	retval = ni_usb_allocate_private(board);
-	if (retval < 0)		{
+	if (retval) {
 		mutex_unlock(&ni_usb_hotplug_lock);
 		return retval;
 	}
-- 
2.43.0