1. 程式人生 > >新路程------ 編譯遇錯

新路程------ 編譯遇錯

遇到錯誤

drivers/spi/rc663.c:1145:2: error: assignment of member 'dev' in read-only object

原因是

rc663_fops.dev = &pdev->dev;這個fops的型別是const,所以出錯,改了就好

遇到錯誤

drivers/spi/spidev1.c:744:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

原因是

變數初始化在執行語句以後

retval = rc663_single_read(lcrc663_IRQ0_REG);

CARD_DETECTED = 0;