Open KuraZuzu opened 4 weeks ago
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1322:21: error: too many arguments to function ‘class_create’
1322 | class_led = class_create(THIS_MODULE, DEVNAME_LED);
モジュールへのポインタが削除されていました。 使われていないため、のようです。
Commit(v6.4): https://github.com/torvalds/linux/commit/1aaba11da9aa7d7d6b52a74d45b31cac118295a1
Doc: https://docs.kernel.org/driver-api/infrastructure.html#c.class_create
互換性を残すため、#if で処理を切り替えます
関数class_create
のエラーに対応してビルドしました。
commit: 9a3044f
関数class_create
をkernel6.4.0以降と以前で処理を切り替えるように修正してビルドを実施しました。
関数class_create
に関するエラーは解消されました。依然として、他のエラーは残っています。
~/RaspberryPiMouse/utils$ ./build_install.bash
build_install_header_from_apt_raspi4.bash
make -C /usr/src/linux-headers-6.8.0-1006-raspi M=/home/ubuntu/RaspberryPiMouse/src/drivers V=0 clean
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-1006-raspi'
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-1006-raspi'
make -C /usr/src/linux-headers-6.8.0-1006-raspi M=/home/ubuntu/RaspberryPiMouse/src/drivers V=0 modules
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-1006-raspi'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: aarch64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
You are using: gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
CC [M] /home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.o
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:323:15: error: initialization of ‘void (*)(struct spi_device *)’ from incompatible pointer type ‘int (*)(struct spi_device *)’ [-Werror=incompatible-pointer-types]
323 | .remove = mcp3204_remove,
| ^~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:323:15: note: (near initialization for ‘mcp3204_driver.remove’)
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:360:14: error: initialization of ‘int (*)(struct i2c_client *)’ from incompatible pointer type ‘int (*)(struct i2c_client *, const struct i2c_device_id *)’ [-Werror=incompatible-pointer-types]
360 | .probe = rtcnt_i2c_probe,
| ^~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:360:14: note: (near initialization for ‘i2c_counter_driver.probe’)
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:361:15: error: initialization of ‘void (*)(struct i2c_client *)’ from incompatible pointer type ‘int (*)(struct i2c_client *)’ [-Werror=incompatible-pointer-types]
361 | .remove = rtcnt_i2c_remove,
| ^~~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:361:15: note: (near initialization for ‘i2c_counter_driver.remove’)
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1120:6: warning: no previous prototype for ‘update_signed_count’ [-Wmissing-prototypes]
1120 | void update_signed_count(struct rtcnt_device_info *dev_info, int rtcnt_count)
| ^~~~~~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1156:6: warning: no previous prototype for ‘reset_signed_count’ [-Wmissing-prototypes]
1156 | void reset_signed_count(struct rtcnt_device_info *dev_info, int rtcnt_count)
| ^~~~~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c: In function ‘mcp3204_get_value’:
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1780:18: error: implicit declaration of function ‘spi_busnum_to_master’ [-Werror=implicit-function-declaration]
1780 | master = spi_busnum_to_master(mcp3204_info.bus_num);
| ^~~~~~~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1780:16: warning: assignment to ‘struct spi_controller *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1780 | master = spi_busnum_to_master(mcp3204_info.bus_num);
| ^
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c: In function ‘mcp3204_init’:
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1842:16: warning: assignment to ‘struct spi_controller *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1842 | master = spi_busnum_to_master(mcp3204_info.bus_num);
| ^
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c: In function ‘mcp3204_exit’:
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1871:16: warning: assignment to ‘struct spi_controller *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1871 | master = spi_busnum_to_master(mcp3204_info.bus_num);
| ^
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c: At top level:
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:2138:5: warning: no previous prototype for ‘dev_init_module’ [-Wmissing-prototypes]
2138 | int dev_init_module(void)
| ^~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:2295:6: warning: no previous prototype for ‘dev_cleanup_module’ [-Wmissing-prototypes]
2295 | void dev_cleanup_module(void)
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:243: /home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.8.0-1006-raspi/Makefile:1926: /home/ubuntu/RaspberryPiMouse/src/drivers] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-1006-raspi'
make: *** [Makefile:9: rtmouse.ko] Error 2
不具合の概要
Ubuntu24.04 Server の環境でデバイスドライバのビルドをすると失敗する。
実行環境
再現方法
RT Corporation Software Tutorials -> Raspberrry Pi Mouse ->デバイスドライバのインストールの手順に従う。ただし、OSは
Ubuntu 24.04
を使用する。Ubuntuの24.04 Server
のイメージを選択したmicroSDカードを用意する(ユーザー名はubuntu
とした)$ ./build_install.bash
を実行してビルド・インストールをする期待する動作
ビルドに成功する
ログ・画像
ビルド時に以下のエラーが出力される
その他