Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors from 2023 #27

Open
enomado opened this issue Sep 26, 2023 · 3 comments
Open

Compile errors from 2023 #27

enomado opened this issue Sep 26, 2023 · 3 comments

Comments

@enomado
Copy link

enomado commented Sep 26, 2023

Trying to make and

make[1]: Entering directory '/usr/lib/modules/6.5.4-arch2-1/build'
  CC [M]  /home/sc/t/spi-ch341-usb/spi-ch341-usb.o
/home/sc/t/spi-ch341-usb/spi-ch341-usb.c:163:30: error: field 'gpio' has incomplete type
  163 |     struct gpio_chip         gpio;                              // chip descriptor for GPIOs
      |                              ^~~~

/home/sc/t/spi-ch341-usb/spi-ch341-usb.c: In function 'ch341_spi_probe':
/home/sc/t/spi-ch341-usb/spi-ch341-usb.c:598:33: error: implicit declaration of function 'spi_busnum_to_master' [-Werror=implicit-function-declaration]
  598 |     while ((ch341_dev->master = spi_busnum_to_master(bus)))
@enomado
Copy link
Author

enomado commented Sep 26, 2023

fixed by adding

#include <linux/gpio/driver.h>

@enomado
Copy link
Author

enomado commented Sep 26, 2023

Now it cant find gpio_export. What a beautiful language.

@enomado enomado changed the title Field 'gpio' has incomplete type Compile errors from 2023 Sep 26, 2023
@Pigpog
Copy link

Pigpog commented Oct 15, 2023

There have been significant changes to the Linux kernel's GPIO API, which removed a few functions. The SPI API changed as well, removing spi_busnum_to_master. I think the SPI probe function will need to be mostly rewritten with the new device tree paradigm.

In addition, all instances of the term "master" have been deprecated and replaced with "controller", though for now there are macros keeping it backwards compatible.

A maintained fork (that built successfully on my 6.5.7 kernel) can be found at dimich-dmb/spi-ch341-usb

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants