char: xillybus: use devm_add_action_or_reset
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Sat, 30 Apr 2016 16:13:20 +0000 (17:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Apr 2016 21:04:45 +0000 (14:04 -0700)
commitbd83a4ab569ddfc71a82fb0dd002f353b67df7df
treec812c9d780a1a8d17199c421170ad21b1a93f7de
parentea37a6b8a0b9fbe3f85b4b9da3206c28f1de6f8e
char: xillybus: use devm_add_action_or_reset

If devm_add_action() fails we are explicitly calling dma_unmap_single(),
pci_unmap_single() and kfree(). Lets use the helper
devm_add_action_or_reset() and return directly in case of error, as we
know that the cleanup function has been already called by the helper if
there was any error. At that same time remove the variable rc which
becomes unused now.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/xillybus/xillybus_of.c
drivers/char/xillybus/xillybus_pcie.c