[PATCH v3 01/27] gpib: agilent_82350b: Unify *allocate_private usage

Dominik Karol Piątkowski posted 27 patches 3 weeks, 3 days ago
[PATCH v3 01/27] gpib: agilent_82350b: Unify *allocate_private usage
Posted by Dominik Karol Piątkowski 3 weeks, 3 days ago
Use the return value of agilent_82350b_allocate_private in calling code
as early return value in case of error.

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

v3:
- Split commit into smaller pieces
- Improve changelog
- Change `(retval < 0)` to `(retval)`

 drivers/gpib/agilent_82350b/agilent_82350b.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpib/agilent_82350b/agilent_82350b.c b/drivers/gpib/agilent_82350b/agilent_82350b.c
index 01a5bb43cd2d..d55d097aa6f0 100644
--- a/drivers/gpib/agilent_82350b/agilent_82350b.c
+++ b/drivers/gpib/agilent_82350b/agilent_82350b.c
@@ -599,8 +599,9 @@ static int agilent_82350b_generic_attach(struct gpib_board *board,
 
 	board->status = 0;
 
-	if (agilent_82350b_allocate_private(board))
-		return -ENOMEM;
+	retval = agilent_82350b_allocate_private(board);
+	if (retval)
+		return retval;
 	a_priv = board->private_data;
 	a_priv->using_fifos = use_fifos;
 	tms_priv = &a_priv->tms9914_priv;
-- 
2.43.0