Re: error: expected '=', ',', ';', 'asm' or '__attrib



Sergey Kubushin wrote:
Robert Adsett <subscriptions@xxxxxxxxxxxxxxxxxxxxx> wrote:
In article <1167470530.933569.143970@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, techie.embedded@xxxxxxxxx says...
Hi

I'm trying to compile an ADC Driver & come acrosss the following error.
I've no experience writing drivers before, and hence have no clue how
to fix it.
Hope someone out there has encountered the problem & suggesst a fix for
the same.

The Error is I get is :

qadc.c: At top level:
qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'qadc_read'
make: *** [qadc.o] Error 1
[root@localhost qadc]#
<snip>
/* Structure to declare our file access functions. */
struct file_operations qadc_fops =
{
open: qadc_open,
read: qadc_read,
write: qadc_write,
release: qadc_release
};

Well, the above isn't valid C so I'd start there.

It was some time back but now it's changed.

---
******************************************************************
* KSI@home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

The syntax was an extension in gcc to simplify Linux device drivers. If you are not using gcc the compiler doesn't recognize it. It has been years since I have written a Linux device driver so the construct could have changed an be no longer supported. (I know they made some changed in device drivers in the newer kernels.)
.



Relevant Pages

  • ANNOUNCE: DJGPP port of FreeBE/AF 1.2 uploaded.
    ... This is a port of FreeBE/AF 1.2 to MSDOS/DJGPP. ... DJGPP specific changes. ... Please note that I have no hardware to test if the drivers really work. ... To compile this program the allegro library and certain ...
    (comp.os.msdos.djgpp)
  • wusb54gsc on ubuntu, was:Back to ubuntu
    ... but not in regular ubuntu 6.06 or any other version of ubuntu? ... so i attempted to compile the drivers on ubuntu 7.04, ... that under kubuntu 6.06 you were using a compatible kernel, ...
    (Ubuntu)
  • RE: [SLE] Hightpoint 374 Raid Controller
    ... For SuSE 9.0 Pro you need to compile the open source drives. ... with the drivers for SuSE 8.2 are pretty close and I was able to get them working. ...
    (SuSE)
  • Re: Video editing in Linux?
    ... >30ukp, and even then a typical winmodem was 25ukp, so the difference ... of course Linux may deal with this alot ... Most notably the IDE drivers way exceed that of VIA's. ... So i would need to compile them? ...
    (alt.linux)
  • Re: Driver compilation question?
    ... Is there somewhere that keeps compiled drivers for various versions ... kernel source to compile against!) ... Is "common sense" really valid? ...
    (Debian-User)