summaryrefslogtreecommitdiff
path: root/drivers/staging/ipack
AgeCommit message (Collapse)Author
2012-07-17Staging: ipack: change naming convention in TODO fileSamuel Iglesias Gonsálvez
Use the ANSI/VITA 4.0-1995 (S2011) naming convention for the mezzanine or daughter boards. They are called IP modules in the Standard. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-17Staging: ipack: added development mailing list in TODO fileSamuel Iglesias Gonsálvez
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-17Staging: ipack/devices/ipoctal: initialize the device in probe functionSamuel Iglesias Gonsálvez
Initialize the device when registering it. Sometimes the user access to it and the device is in an unknown state, so it could fail. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-17Staging: ipack/devices/ipoctal: fix dereference NULL pointerSamuel Iglesias Gonsálvez
After opening and closing the file /dev/ipoctal.X.Y.Z for the second time, it gives a kernel oops due to a dereference of a NULL pointer. The problem was that tty->driver_data was not properly initialized when accessing the file for the second time. Reported-by: Alberto Garcia Gonzalez <agarcia@igalia.com> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06Staging: ipack/devices/ipoctal: save IRQ vector in MEM spaceSamuel Iglesias Gonsálvez
The IRQ vector should be saved in MEM space base address according to the datasheet. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25Staging: ipack/devices/ipoctal: remove unneeded lock in IRQ handlerSamuel Iglesias Gonsalvez
In the rest of the code, the data is protected with spin_lock_irqsave(). Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25Staging: ipack/bridges/tpci200: remove unneeded lock in irq handlerSamuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25Staging: ipack/devices/ipoctal: remove unneeded includesSamuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25Staging: ipack/devices/ipoctal: fix oops when accessing "buffer"Samuel Iglesias Gonsalvez
The buffer[][] field was replaced by tty_port->xmit_buf field but there was some places that "buffer" was still accessed, giving a kernel oops because it was uninitialized. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12Staging: ipack: delete sysfs from to-do list.Samuel Iglesias Gonsalvez
As we have already got rid of sysfs files in the tpci200 driver, it is needed to delete that mention in the TODO file. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12Staging: ipack: remove pr_fmt definition.Samuel Iglesias Gonsalvez
As there is no pr_* function used here, pr_fmt is not needed. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Staging: ipack/bridges/tpci200: change device table definition and export it.Miguel Gómez
Use DEFINE_PCI_DEVICE_TABLE() to create the device table and add MODULE_DEVICE_TABLE() to export it. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Staging: ipack/devices/ipoctal: remove unused enum uart_parity_e.Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Staging: ipack/devices/ipoctal: remove error_flag field from ipoctal struct.Miguel Gómez
Remove the error_flag field from the ipoctal structure, as the error code is handled through the tty abstraction. Remove the values definition as well. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Staging: ipack/devices/ipoctal: remove ipoctal_config structure.Miguel Gómez
The configuration of the communication channel is handled by the tty abstraction, so the ipoctal_config structure has become useless and it's only used to store values that are never accesed. Remove it. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Staging: ipack/bridges/tpci200: remove gotos in tpci200_install()Miguel Gómez
Remove the gotos when handling error conditions, as the code gets clearer and the gotos are not really avoiding code replication. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Staging: ipack/bridges/tpci200: remove "out" label in tpci200_request_irq()Miguel Gómez
Remove the "out" label from tpci200_request_irq(), as it can directly return the error code instead of jumping. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Staging: ipack/bridges/tpci200: remove useless break in tpci200_slot_map_space()Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Staging: ipack/bridges/tpci200: remove "out" label in tpci200_slot_map_space()Miguel Gómez
Remove the "out" label from tpci200_slot_map_space(), as it can directly return the error code instead of jumping. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Staging: ipack/bridges/tpci200: remove gotos in tpci200_free_irq().Miguel Gómez
Handle error conditions with simple returns instead of usig gotos. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/devices/ipoctal: change pr_* usage for dev_* functionsSamuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: change pr_* usage for dev_* functionsSamuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: fix kernel oops when uninstalling a deviceSamuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: avoid dereference of a freed tpci200->infoSamuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/devices/ipoctal: avoid kernel oops when uninstallingSamuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack: delete the call to remove() in ipack_driver_registerSamuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack: use idr interface for numbering busesSamuel Iglesias Gonsalvez
Use idr interface to give the bus number. That way, we remove the limitation of 64 buses. The mutex is removed because the ida interface uses spinlocks inside, so it is not needed an extra lock. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: removed check of tpci200->slots[dev->slot].devSamuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: remove name field from slot_irqSamuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: fix indention.Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: check if the remove function is availableSamuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: tpci200_slot_map_space() should return 0 if ↵Samuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: tpci200_slot_unmap_space() should return 0 ↵Samuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack: return proper value in match() functionSamuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack/bridges/tpci200: delete sysfs filesSamuel Iglesias Gonsalvez
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07Staging: ipack: Remove version.h header file inclusionSachin Kamat
version.h header file is no longer required. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-19Staging: ipack/bridges/tpci200: remove unneeded castsSamuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-19Staging: ipack/bridges/tpci200: remove TPCI200_SHORTNAME constantSamuel Iglesias Gonsalvez
Removed TPCI200_SHORTNAME. For the pr_* the name of the module is already included due to pr_fmt declaration. In other cases, KBUILD_MODNAME is used instead. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-19Staging: ipack: remove board_name and bus_name fields from struct ipack_deviceSamuel Iglesias Gonsalvez
Removed board_name and bus_name fields from struct ipack_device that are completely useless. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-19Staging: ipack: improve the register of a bus and a device in the bus.Samuel Iglesias Gonsalvez
It adds and removes some fields in the struct ipack_device and ipack_bus_device to make it cleaner. The API has change to group all the operations on these structures inside of the ipack driver. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14Staging: ipack: fix a few sparse warningsSamuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14Staging: ipack: added more info in Kconfig's help about ipackSamuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14Staging: ipack/devices/ipoctal: change the licence to explicitly GPLv2Samuel Iglesias Gonsalvez
Change the licence to explicitly GPLv2 to avoid possible conflicts in the future. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14Staging: ipack/bridges/tpci200: change the licence to explicitly GPLv2Samuel Iglesias Gonsalvez
Change the licence to explicitly GPLv2 to avoid possible conflicts in the future. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14Staging: ipack: change the licence to explicitly GPLv2Samuel Iglesias Gonsalvez
Change the licence to explicitly GPLv2 to avoid possible conflicts in the future. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14Staging: ipack: add contact email in TODO fileSamuel Iglesias Gonsalvez
Added myself in the TODO file. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14Staging: ipack: move the devices source line in Kconfig fileSamuel Iglesias Gonsalvez
Maintain the proper order of definitions in Kconfig following the time order of the commits. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10Staging: ipack: dereferencing freed memoryDan Carpenter
We free "dev" then dereference it on the next line. Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10Staging: ipack: returning a freed pointerDan Carpenter
If ipack_device_register() returns an error, then we returned a freed pointer. The caller doesn't use it, but it means we return success to the user instead of returning an error code. I kind of rewrote the error handling in this function as a cleanup. Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-09Staging: ipack: add support for IP-OCTAL mezzanine boardSamuel Iglesias Gonsalvez
IP-OCTAL is a 8-channels serial port device. There are several models one per each standard: RS-232, RS-422, RS-485. This driver can manage all of them. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>