Skip to content
Snippets Groups Projects
Commit 2b85fda2 authored by Federico Vaga's avatar Federico Vaga
Browse files

wr-nic-gpio: do not check on gpiochip_remove


Since kernel 3.18 the gpiochip_remove function return void and not an
error code as before. In case the gpiochip is removed while there is a
requested gpio, the kernel will print an error message.

By applying this patch without any control on the kernel version we are
going to loose the error message in case of trouble with old kernels

Signed-off-by: default avatarFederico Vaga <federico.vaga@cern.ch>
parent da456dfc
Branches
Tags
No related merge requests found
......@@ -9,6 +9,7 @@
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/fmc.h>
......@@ -88,13 +89,18 @@ out_free:
void wrn_gpio_exit(struct fmc_device *fmc)
{
int ret;
struct wrn_drvdata *dd = fmc_get_drvdata(fmc);
struct gpio_chip *gc = dd->gc;
#if LINUX_VERSION_CODE > KERNEL_VERSION(3,17,0)
gpiochip_remove(gc);
#else
int ret;
ret = gpiochip_remove(gc);
if (ret)
dev_err(fmc->hwdev, "DANGER %i! gpio chip can't be removed\n",
ret);
#endif
return;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment