X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=target%2Flinux%2Far71xx%2Ffiles%2Fdrivers%2Fgpio%2Fgpio-nxp-74hc153.c;h=1355e3ff6e588d8af636b8de20697debcd2fd08b;hp=a5fec5ca7d1cffc1e6f31efbc1e27d6fc71772e2;hb=7bbf4117c6fe;hpb=aad175d5b6a015f0bfc35436952638df0bc57ded diff --git a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c index a5fec5ca7d..1355e3ff6e 100644 --- a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c +++ b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -74,7 +75,7 @@ static void nxp_74hc153_set_value(struct gpio_chip *gc, /* not supported */ } -static int __devinit nxp_74hc153_probe(struct platform_device *pdev) +static int nxp_74hc153_probe(struct platform_device *pdev) { struct nxp_74hc153_platform_data *pdata; struct nxp_74hc153_chip *nxp; @@ -167,7 +168,11 @@ static int __devinit nxp_74hc153_probe(struct platform_device *pdev) gc->base = pdata->gpio_base; gc->ngpio = NXP_74HC153_NUM_GPIOS; gc->label = dev_name(nxp->parent); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) gc->dev = nxp->parent; +#else + gc->parent = nxp->parent; +#endif gc->owner = THIS_MODULE; err = gpiochip_add(&nxp->gpio_chip); @@ -198,6 +203,7 @@ static int nxp_74hc153_remove(struct platform_device *pdev) struct nxp_74hc153_platform_data *pdata = pdev->dev.platform_data; if (nxp) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) int err; err = gpiochip_remove(&nxp->gpio_chip); @@ -207,7 +213,9 @@ static int nxp_74hc153_remove(struct platform_device *pdev) err); return err; } - +#else + gpiochip_remove(&nxp->gpio_chip); +#endif gpio_free(pdata->gpio_pin_2y); gpio_free(pdata->gpio_pin_1y); gpio_free(pdata->gpio_pin_s1); @@ -222,7 +230,7 @@ static int nxp_74hc153_remove(struct platform_device *pdev) static struct platform_driver nxp_74hc153_driver = { .probe = nxp_74hc153_probe, - .remove = __devexit_p(nxp_74hc153_remove), + .remove = nxp_74hc153_remove, .driver = { .name = NXP_74HC153_DRIVER_NAME, .owner = THIS_MODULE,