ipack: split ipack_device_register() in several functions
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Fri, 8 Mar 2013 08:21:47 +0000 (09:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Mar 2013 19:23:09 +0000 (12:23 -0700)
commite926301b39a07f587ff8c66354a2e2ee4c29162c
tree407121dd6ef41bfa48681e2ed4f7f48bf85b5f40
parentfa882867ae5f8543eb304a1667563f1c99514475
ipack: split ipack_device_register() in several functions

One function is ipack_device_init(). If it fails, the caller should execute
ipack_put_device().

The second function is ipack_device_add that only adds the device. If
it fails, the caller should execute ipack_put_device().

Then the device is removed with refcount = 0, as device_register() kernel
documentation says.

ipack_device_del() is added to remove the device.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ipack/carriers/tpci200.c
drivers/ipack/ipack.c
include/linux/ipack.h