mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-02 09:21:19 -04:00
gpib: cb7210: Unify *allocate_private usage
Use the return value of cb7210_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-5-dominik.karol.piatkowski@protonmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1ec138c8db
commit
0ea001af4e
@@ -875,11 +875,13 @@ static int cb7210_generic_attach(struct gpib_board *board)
|
||||
{
|
||||
struct cb7210_priv *cb_priv;
|
||||
struct nec7210_priv *nec_priv;
|
||||
int retval;
|
||||
|
||||
board->status = 0;
|
||||
|
||||
if (cb7210_allocate_private(board))
|
||||
return -ENOMEM;
|
||||
retval = cb7210_allocate_private(board);
|
||||
if (retval)
|
||||
return retval;
|
||||
cb_priv = board->private_data;
|
||||
nec_priv = &cb_priv->nec7210_priv;
|
||||
nec_priv->read_byte = nec7210_locking_ioport_read_byte;
|
||||
|
||||
Reference in New Issue
Block a user