我目前正在尝试为我的新笔记本电脑的 SD 卡读卡器(Realtek RTS5229)编译驱动程序。但是,运行时make
出现以下错误:
$ make # reduced messages to errors
/home/sebastian/UbuntuSetup/Realtek_RTS5229_Linux_Driver_v1.07/rts5229/rtsx.c:266:2: error: unknown field ‘proc_info’ specified in initializer
.proc_info = proc_info,
^
/home/sebastian/UbuntuSetup/Realtek_RTS5229_Linux_Driver_v1.07/rts5229/rtsx.c:914:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_probe’
static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
^
/home/sebastian/UbuntuSetup/Realtek_RTS5229_Linux_Driver_v1.07/rts5229/rtsx.c:1069:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_remove’
static void __devexit rtsx_remove(struct pci_dev *pci)
^
/home/sebastian/UbuntuSetup/Realtek_RTS5229_Linux_Driver_v1.07/rts5229/rtsx.c:1094:11: error: ‘rtsx_probe’ undeclared here (not in a function)
.probe = rtsx_probe,
^
/home/sebastian/UbuntuSetup/Realtek_RTS5229_Linux_Driver_v1.07/rts5229/rtsx.c:1095:2: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
.remove = __devexit_p(rtsx_remove),
^
/home/sebastian/UbuntuSetup/Realtek_RTS5229_Linux_Driver_v1.07/rts5229/rtsx.c:1095:24: error: ‘rtsx_remove’ undeclared here (not in a function)
.remove = __devexit_p(rtsx_remove),
^
cc1: some warnings being treated as errors
make[2]: *** [/home/sebastian/UbuntuSetup/Realtek_RTS5229_Linux_Driver_v1.07/rts5229/rtsx.o] Error 1
make[1]: *** [_module_/home/sebastian/UbuntuSetup/Realtek_RTS5229_Linux_Driver_v1.07/rts5229] Error 2
make: *** [default] Error 2
错误发生在rtsx.c(已上传至我的 Dropbox)
Ubuntu Trusty x64
答案1
您不需要编译它们。它们位于以下软件包中,请安装它们。
sudo apt-get install build-essential libssl-dev linux-headers-`uname -r` linux-firmware-nonfree