roadrunner2 / macbook12-spi-driver

Input driver for the SPI touchpad / keyboard found in the 12" MacBook (MacBook8,1 + MacBook9,1) and 2016 through 2018 Macbook Pro's (MacBookPro13,* and 14,*); a Touch Bar driver is also available.
GNU General Public License v2.0
256 stars 50 forks source link

Compile error in 5.9.0-1 too few arguments to function ‘iio_device_alloc’ #54

Open marc-git opened 4 years ago

marc-git commented 4 years ago

I get the following error log. Is this a naming conflict?

/var/lib/dkms/applespi/0.1/build/apple-ib-als.c:463:29: warning: passing argument 1 of ‘iio_device_alloc’ makes pointer from integer without a cast [-Wint-conversion]
  463 |  iio_dev = iio_device_alloc(sizeof(als_dev));
      |                             ^~~~~~~~~~~~~~~
      |                             |
      |                             long unsigned int
In file included from /usr/src/linux-headers-5.9.0-1-common/include/linux/iio/buffer.h:10,
                 from /var/lib/dkms/applespi/0.1/build/apple-ib-als.c:32:
/usr/src/linux-headers-5.9.0-1-common/include/linux/iio/iio.h:684:49: note: expected ‘struct device *’ but argument is of type ‘long unsigned int’
  684 | struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv);
      |                                  ~~~~~~~~~~~~~~~^~~~~~
/var/lib/dkms/applespi/0.1/build/apple-ib-als.c:463:12: error: too few arguments to function ‘iio_device_alloc’
  463 |  iio_dev = iio_device_alloc(sizeof(als_dev));
      |            ^~~~~~~~~~~~~~~~
In file included from /usr/src/linux-headers-5.9.0-1-common/include/linux/iio/buffer.h:10,
                 from /var/lib/dkms/applespi/0.1/build/apple-ib-als.c:32:
/usr/src/linux-headers-5.9.0-1-common/include/linux/iio/iio.h:684:17: note: declared here
  684 | struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv);
      |                 ^~~~~~~~~~~~~~~~
make[3]: *** [/usr/src/linux-headers-5.9.0-1-common/scripts/Makefile.build:288: /var/lib/dkms/applespi/0.1/build/apple-ib-als.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:1796: /var/lib/dkms/applespi/0.1/build] Error 2
make[1]: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.9.0-1-amd64'
make: *** [Makefile:16: all] Error 2
0neGal commented 4 years ago

A temporary fix is to comment the line out, that being line 463 in apple-ib-als.c that'll allow you to compile it, not sure what side effects this could have for Mac's with an iBridge/T2/TouchBar, I haven't been able to test that.

This only really and intermediary until someone either PR's a fix or @roadrunner2 makes a fix.

marc-git commented 4 years ago

A temporary fix is to comment the line out, that being line 463 in apple-ib-als.c that'll allow you to compile it, not sure what side effects this could have for Mac's with an iBridge/T2/TouchBar, I haven't been able to test that.

This only really and intermediary until someone either PR's a fix or @roadrunner2 makes a fix.

Did you test if it works on macs without the T2 ? I'm interesting in getting the touchbar on my MBP 14,3 working again. Tried the current pull request too but that didn't work (compiled though).

0neGal commented 4 years ago

Unfortunately no.

I haven't been able to use the original fork nor roadrunner's they both get the same error messages (dmesg | grep applespi) and it doesn't seem to work even when reloading the module...

Can't for the life of me figure out why...

fannullone commented 3 years ago

I got the touchbar back working: https://github.com/roadrunner2/macbook12-spi-driver/issues/42#issuecomment-753445371

ghost commented 3 years ago

I forked it here with rado0x54's fix: https://github.com/PatrickVerner/macbook12-spi-driver

marc-git commented 3 years ago

I forked it here with rado0x54's fix: https://github.com/PatrickVerner/macbook12-spi-driver cheers, i'll test on the weekend

marc-git commented 3 years ago

Yes works great for me straight from your fork @PatrickVerner

marc-git commented 3 years ago

Sorry not closing because fork is not merged yet