Staging ipack/bridges/tpci200: delete sysfs files

To perform the installation of a mezzanine it was needed to write on these
files, now it is not needed at all as the device model is properly implemented.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack: return proper value in match() function

It should return the same value given by the match function of the ipack_driver
that has been called.

Returning 0 here, means that the match has failed and it could be succeed.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack/bridges/tpci200: tpci200_slot_unmap_space() should return 0 if succeed.

tpci200_slot_unmap_space() should return 0 if the operation was properly done. If
not, the caller will think that something wrong happened.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack/bridges/tpci200: tpci200_slot_map_space() should return 0 if succeed.

tpci200_slot_map_space() should return 0 if the operation was properly
done. If not, the caller will think that something wrong happened.

This patch establish the returned value to 0. It is overwritten in case of
error.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack/bridges/tpci200: check if the remove function is available

To avoid a dereference of a NULL pointer, the availability of the function is
checked before its use.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack/bridges/tpci200: fix indention.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack/bridges/tpci200: remove name field from slot_irq

This field is not needed at all, as the IRQ is registered for the carrier not
for the mezzanine.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging ipack/bridges/tpci200: removed check of tpci200->slots[dev->slot].dev

When ipack_device_register() is called, the variable
tpci200->slots[dev->slot].dev has not assigned a value and it gives an error
when the mezzanine driver is reading a register from the board for the match()
function, as all the I/O functions call check_slot().

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack: use idr interface for numbering buses

Use idr interface to give the bus number. That way, we remove the stupid
limitation of 64 buses.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack: delete the call to remove() in ipack_driver_register

When a bus driver calls ipack_driver_register(), it should manages the returning
NULL value to undo all the operations it did before this call, and print the
corresponding trace.

It is not a task for the ipack driver to call the remove() function here.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack/devices/ipoctal: avoid kernel oops when uninstalling

When uninstalling a device, there is a loop of calls that produces, at the end,
two calls to __ipoctal_remove() function with the same ipack_device argument.

The first time works fine, but the second will fail in tty_unregister_driver()

To avoid this situation, the call to __ipoctal_remove() it is done only from the
ipack bus driver and not from the ipack device driver.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack/bridges/tpci200: avoid dereference of a freed tpci200->info

tpci200->info is used later when uninstalling the module. As there is another
kfree in the proper place, this patch removes the wrong one.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Staging: ipack/bridges/tpci200: fix kernel oops when uninstalling a device

When uninstalling a device, the call to the ipack_bus_ops remove() frees
resources in the ipack device driver but without unregistering the device.

It generates a kernel oops when somebody wants to unregister the device.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>