diff options
| author | Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com> | 2026-01-16 17:48:24 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-01-27 16:04:07 +0100 |
| commit | 1dd1bc4d79431e3cb0b8581882bd4afa57443d12 (patch) | |
| tree | 3e22b1280845c3d22cb92db778a812c148c3ba08 /drivers/gpib | |
| parent | ad161c8b12100cbe80980be03e03d324f7d45fc7 (diff) | |
| download | lwn-1dd1bc4d79431e3cb0b8581882bd4afa57443d12.tar.gz lwn-1dd1bc4d79431e3cb0b8581882bd4afa57443d12.zip | |
gpib: gpio: Unify *allocate_private usage
Use the return value of 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>
Link: https://patch.msgid.link/20260116174647.317256-14-dominik.karol.piatkowski@protonmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpib')
| -rw-r--r-- | drivers/gpib/gpio/gpib_bitbang.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpib/gpio/gpib_bitbang.c b/drivers/gpib/gpio/gpib_bitbang.c index 62adcab1ddfb..ba99d6c95ddf 100644 --- a/drivers/gpib/gpio/gpib_bitbang.c +++ b/drivers/gpib/gpio/gpib_bitbang.c @@ -1205,14 +1205,15 @@ static void bb_detach(struct gpib_board *board) static int bb_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct bb_priv *priv; - int retval = 0; + int retval; dbg_printk(2, "%s\n", "Enter ..."); board->status = 0; - if (allocate_private(board)) - return -ENOMEM; + retval = allocate_private(board); + if (retval) + return retval; priv = board->private_data; priv->direction = -1; priv->t1_delay = 2000; |
