Commit 72d18a38 authored by Gwenhael Goavec-Merou's avatar Gwenhael Goavec-Merou Committed by Vaibhav Gupta

drivers/zio/devices/zio-ad788x: fix build with kernel >= 5.16.0 and 5.18.0

parent 2b143c97
...@@ -221,7 +221,11 @@ static int ad788x_input_cset(struct zio_cset *cset) ...@@ -221,7 +221,11 @@ static int ad788x_input_cset(struct zio_cset *cset)
spi_message_add_tail(&context->transfer, &context->message); spi_message_add_tail(&context->transfer, &context->message);
/* start acquisition */ /* start acquisition */
#if KERNEL_VERSION(5, 16, 0) > LINUX_VERSION_CODE
err = spi_async_locked(ad788x->spi, &context->message); err = spi_async_locked(ad788x->spi, &context->message);
#else
err = spi_async(ad788x->spi, &context->message);
#endif
if (!err) if (!err)
return -EAGAIN; return -EAGAIN;
...@@ -379,7 +383,11 @@ static int ad788x_spi_probe(struct spi_device *spi) ...@@ -379,7 +383,11 @@ static int ad788x_spi_probe(struct spi_device *spi)
return err; return err;
} }
#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
static int ad788x_spi_remove(struct spi_device *spi) static int ad788x_spi_remove(struct spi_device *spi)
#else
static void ad788x_spi_remove(struct spi_device *spi)
#endif
{ {
struct zio_device *zdev; struct zio_device *zdev;
struct ad788x *ad788x; struct ad788x *ad788x;
...@@ -390,7 +398,9 @@ static int ad788x_spi_remove(struct spi_device *spi) ...@@ -390,7 +398,9 @@ static int ad788x_spi_remove(struct spi_device *spi)
zio_unregister_device(zdev); zio_unregister_device(zdev);
kfree(ad788x); kfree(ad788x);
zio_free_device(zdev); zio_free_device(zdev);
#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
return 0; return 0;
#endif
} }
static struct spi_driver ad788x_driver = { static struct spi_driver ad788x_driver = {
......
Markdown is supported
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