# invalid operands to binary &



## nikobordx (Mar 31, 2009)

Hi everyone,

I'm trying to build a driver under FreeBSD 8-Current, but when i'm compile, gcc return:

video.c: In function 'video_open':
video.c:1120: error: invalid operands to binary &

The line 1120 is:

sc = devclass_get_softc(video_devclass, VIDEOUNIT(dev));

I don't understand this error, do i need to include more header file ?

Thanks in advance,
Nicolas.


----------



## SirDice (Apr 1, 2009)

Not sure but it looks like VIDEOUNIT is a macro, it may need more parameters.


----------



## nikobordx (Apr 1, 2009)

Hi,
Thanks for your response.
I already found the solution !

I replaced the line:
sc = devclass_get_softc(video_devclass, VIDEOUNIT(dev));

by:
sc = devclass_get_softc(video_devclass, VIDEOUNIT(dev2unit(dev)));

And it compile correctly.
Nicolas.


----------

