0002-spi.c-fix-build-failure-on-remove-callback.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From a88819bd63f977b5a33d72a2b9e264ce104726bd Mon Sep 17 00:00:00 2001
  2. From: Giulio Benetti <giulio.benetti@benettiengineering.com>
  3. Date: Wed, 28 Dec 2022 21:02:12 +0100
  4. Subject: [PATCH] spi.c: fix build failure on remove callback
  5. Starting from Linux 5.18 remove callback returns void, so let's deal with
  6. it depending on Linux version >= 5.18.
  7. [Upstream status: https://github.com/embeddedTS/wilc3000-external-module/pull/2]
  8. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
  9. ---
  10. spi.c | 7 +++++++
  11. 1 file changed, 7 insertions(+)
  12. diff --git a/spi.c b/spi.c
  13. index 96c51fe..f7b43e2 100644
  14. --- a/spi.c
  15. +++ b/spi.c
  16. @@ -211,7 +211,11 @@ free:
  17. return ret;
  18. }
  19. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0))
  20. +static void wilc_bus_remove(struct spi_device *spi)
  21. +#else
  22. static int wilc_bus_remove(struct spi_device *spi)
  23. +#endif
  24. {
  25. struct wilc *wilc = spi_get_drvdata(spi);
  26. @@ -220,7 +224,10 @@ static int wilc_bus_remove(struct spi_device *spi)
  27. wilc_netdev_cleanup(wilc);
  28. wilc_bt_deinit();
  29. +
  30. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0))
  31. return 0;
  32. +#endif
  33. }
  34. static int wilc_spi_suspend(struct device *dev)
  35. --
  36. 2.34.1