summaryrefslogtreecommitdiffstats
path: root/drivers/iio/dummy/iio_dummy_evgen.c
AgeCommit message (Collapse)AuthorFilesLines
2020-09-21iio: dummy: iio_dummy_evgen: Demote file header and supply description for ↵Lee Jones1-1/+3
'irq_sim_domain' File headers are not good candidates for kerneldoc. Fixes the following W=1 kernel build warning(s): drivers/iio/dummy/iio_dummy_evgen.c:30: warning: Cannot understand * @regs: irq regs we are faking on line 30 - I thought it was a doc line drivers/iio/dummy/iio_dummy_evgen.c:42: warning: Function parameter or member 'irq_sim_domain' not described in 'iio_dummy_eventgen' Signed-off-by: Lee Jones <lee.jones@linaro.org> Cc: Marc Zyngier <maz@kernel.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Link: https://lore.kernel.org/r/20200716135928.1456727-16-lee.jones@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-20iio: dummy_evgen: Fix use after free on error in iio_dummy_evgen_create()Dan Carpenter1-1/+4
We need to preserve the "iio_evgen->irq_sim_domain" error code before we free "iio_evgen" otherwise it leads to a use after free. Fixes: 337cbeb2c13e ("genirq/irq_sim: Simplify the API") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
2020-05-18genirq/irq_sim: Simplify the APIBartosz Golaszewski1-14/+20
The interrupt simulator API exposes a lot of custom data structures and functions and doesn't reuse the interfaces already exposed by the irq subsystem. This patch tries to address it. We hide all the simulator-related data structures from users and instead rely on the well-known irq domain. When creating the interrupt simulator the user receives a pointer to a newly created irq_domain and can use it to create mappings for simulated interrupts. It is also possible to pass a handle to fwnode when creating the simulator domain and retrieve it using irq_find_matching_fwnode(). The irq_sim_fire() function is dropped as well. Instead we implement the irq_get/set_irqchip_state interface. We modify the two modules that use the simulator at the same time as adding these changes in order to reduce the intermediate bloat that would result when trying to migrate the drivers in separate patches. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> #for IIO Link: https://lore.kernel.org/r/20200514083901.23445-3-brgl@bgdev.pl
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-22iio: dummy_evgen: fix possible memleak in evgen initPan Bian1-1/+4
The memory allocated in the function iio_dummy_evgen_create is not released if it fails to add the evgen device to device hierarchy. This may result in a memory leak bug. Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-01-08iio: dummy_evgen: modify the return value check for irq_sim_init()Bartosz Golaszewski1-1/+1
As discussed with Marc Zyngier: irq_sim_init() and its devres variant should return the base of the allocated interrupt range on success rather than 0. This will be modified later - first, change the way users handle the return value of these routines. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-09iio: dummy: evgen: use irq_simBartosz Golaszewski1-70/+19
Switch to using the recently added interrupt simulator for dummy irqs. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2015-10-25iio: Move IIO Dummy Driver out of stagingCristina Opriceana1-0/+262
This patch moves the reference IIO dummy driver from drivers/staging/iio into a separate folder, drivers/iio/dummy and adds the proper Kconfig and Makefile for it. A new config menu entry called IIO dummy driver has also been added in the Industrial I/O support menu, corresponding to this driver. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>