Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm using Linux Mint 15. When I try to compile the EXAR UART driver file version for kernel v3.5.0 and later provided here: http://www.exar.com/connectivity/uart-and-bridging-solutions/usb-uarts/xr21v1410

I get the following error:

v@lenovo-linux ~/Downloads/xr21v141x-lnx-3.5-pak $ sudo make
make -C /lib/modules/3.8.0-19-generic/build M=/home/v/Downloads/xr21v141x-lnx-3.5-pak
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-19-generic'
  LD      /home/v/Downloads/xr21v141x-lnx-3.5-pak/built-in.o
  CC [M]  /home/v/Downloads/xr21v141x-lnx-3.5-pak/vizzini.o
/home/v/Downloads/xr21v141x-lnx-3.5-pak/vizzini.c: In function ‘xr21v141x_tty_set_termios’:
/home/v/Downloads/xr21v141x-lnx-3.5-pak/vizzini.c:1104:22: error: invalid type argument of ‘->’ (have ‘struct ktermios’)
make[2]: *** [/home/v/Downloads/xr21v141x-lnx-3.5-pak/vizzini.o] Error 1
make[1]: *** [_module_/home/v/Downloads/xr21v141x-lnx-3.5-pak] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-19-generic'
make: *** [all] Error 2

How can I resolve this error?

share|improve this question
add comment

2 Answers

Linux kernel interfaces change often. It's up to driver writers to

  • either contribute their code back to the kernel, after which whoever breaks compatibility has to fix the driver;
  • or make their driver evolve to keep up with incompatible interface changes.

The xr21v1410 driver was written for Linux 3.5. The message referring to line 1104 in vizzini.c indicates that a variable of a structure type is being used. Looking at the source, this is tty->termios where tty is of type tty_struct. Around Linux 3.6, the pointer changed to become a struct inside another struct.

You can try fixing this by changing tty->termios to tty.termios throughout the code. However this is unlikely to be the only problem. You should contact the manufacturer and request an updated driver.

share|improve this answer
add comment

I usually first try to find some forum on their website and ask there. If this does not work I try to fix it myself, but there are usually more errors like this and I give up after several of them.

To fix this one:

  1. go to /home/v/Downloads/xr21v141x-lnx-3.5-pak/
  2. open vizzini.c
  3. go to line 1104
  4. there should be something like whatever->whatever
  5. if not, post the line here
  6. if yes, change it to whatever.whatever and retry make

Btw, why do you build as root?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.