kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* make error in building sample code!
       [not found] ` <alpine.LFD.2.00.0908041003500.21757@localhost>
@ 2011-06-23 14:06   ` loody
  0 siblings, 0 replies; only message in thread
From: loody @ 2011-06-23 14:06 UTC (permalink / raw)
  To: kernelnewbies

hi :
sorry for pick up this old thread.

2009/8/4 Robert P. J. Day <rpjday@crashcourse.ca>:
> On Tue, 4 Aug 2009, Greg Peter wrote:
>
>> Hello,
>>
>> I am trying to build LDD3 sample code, just to get expirement around.
>> (Obtained from the link ->
>> http://oreilly.com.cn/codeexample/ldd3/examples.tar.gz).
>>
>> But I get the following errors when I run make: (PS note, I have the kernel
>> source and headers installed)
>>
>>
>> #examples> make
>> for n in misc-progs misc-modules skull scull scullc sculld scullp scullv
>> sbull snull short shortprint pci simple usb tty lddbus; do make -C $n ||
>> exit 1; done
>> make[1]: Entering directory `/home/gregp/examples/misc-progs'
>> cc -O2 -fomit-frame-pointer -Wall
>> -I/lib/modules/2.6.27.23-0.1-pae/build/include??? setlevel.c?? -o setlevel
>> setlevel.c:30: error: expected declaration specifiers or ?...? before ?syslog?
>> setlevel.c:30: error: expected declaration specifiers or ?...? before ?type?
>> setlevel.c:30: error: expected declaration specifiers or ?...? before ?bufp?
>> setlevel.c:30: error: expected declaration specifiers or ?...? before ?len?
>> setlevel.c:30: warning: data definition has no type or storage class
>> setlevel.c:30: warning: type defaults to ?int? in declaration of ?_syscall3?
>> setlevel.c: In function ?main?:
>> setlevel.c:41: warning: implicit declaration of function ?syslog?
>> make[1]: *** [setlevel] Error 1
>> make[1]: Leaving directory `/home/gregp/examples/misc-progs'
>> make: *** [subdirs] Error 1
>
> ?those userspace programs still use the now-deprecated and
> unsupported _syscall macros. ?they should be rewritten to use
> syscall() instead. ?see:
>
> http://www.kernel.org/doc/man-pages/online/pages/man2/_syscall.2.html
>
I can compile the attach lddbus.c successfully but fail to insert the module.
it is because device_register return a non-zero value.
I have also checked other driver to compare the procedure of initial
"struct device", but I cannot see the difference.

take scsi_debug.c for example:
static struct device pseudo_primary = {
        .init_name      = "pseudo_0",
        .release        = pseudo_0_release,
};

static int __init scsi_debug_init(void)
{
......
        ret = device_register(&pseudo_primary);
        if (ret < 0) {
                printk(KERN_WARNING "scsi_debug: device_register error: %d\n",
                        ret);
                goto free_vm;
        }
.....
}

is there any CONFIG in kernel i should open for fixing this problem?

-- 
Regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lddbus.c
Type: text/x-csrc
Size: 3926 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110623/db5310c2/attachment-0001.bin 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-23 14:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <70ecf6a50908040552u174954ddoe202fe8c937db40b@mail.gmail.com>
     [not found] ` <alpine.LFD.2.00.0908041003500.21757@localhost>
2011-06-23 14:06   ` make error in building sample code! loody

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).