Using the call to the ipack_device_unregister() function to avoid the
strange way it was doing, as the device model will take care of calling
the bus's .remove function when a device is being unregistered.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
                return -ERESTARTSYS;
 
        tpci200->slots[dev->slot].dev = NULL;
-       ipack_device_unregister(dev);
        mutex_unlock(&tpci200->mutex);
 
        return 0;
        int i;
 
        for (i = 0; i < TPCI200_NB_SLOT; i++)
-               tpci200_slot_unregister(tpci200->slots[i].dev);
+               ipack_device_unregister(tpci200->slots[i].dev);
 
        tpci200_unregister(tpci200);
        kfree(tpci200->slots);