[gentoo-dev] Trouble with sys fs

2005-09-09 Thread Kormos Matej
Hello!
I am beginner with Gentoo and absolute rookie about writing drivers, but I
am trying to write one.
I hope I have choose the right mailing list for my questions :-)
I have encountered following error:
I have a simple char driver. Everything is working like should be, I can
compile functional driver, which after inserting into system appears in the
sys file system.
But when I add this lines in order to create my own attribute in directory
of my module:

#include linux/sysfs.h
#include linux/kobject.h

sysfs_create_file(device-cdev.kobj,pid_sfs);

I can not insert module. Kernel says something like this:
Error inserting module -1: unknown symbol sysfs_create_file

And my second problem is, when I try to create my own kobject and add it to
sys fs, when I call insmod, segmentation fault occures on kobejct_add()

struct kobject mykobject;
static int __init mymodule_init(void)
{
  int err;
 
  kobject_init(mykobject);
  mykobject.parent-cdev.kobj;
  mykobject.ktype=kotype;  
  kobject_set_name(mykobject,mymodule);
  err=kobject_add(mykobject);
  


Do you have any suggesions what may be wrong?
(is it necessary to do something special to interact with sysfs? I have do
exactly what was written in Linux Device Drivers from O'Reilly publishing)


-- 
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] Trouble with sys fs

2005-09-09 Thread Daniel Drake

Kormos Matej wrote:

Hello!
I am beginner with Gentoo and absolute rookie about writing drivers, but I
am trying to write one.
I hope I have choose the right mailing list for my questions :-)


You should try the kernel-newbies mailing list, or the linux kernel mailing 
list.


I have encountered following error:
I have a simple char driver. Everything is working like should be, I can
compile functional driver, which after inserting into system appears in the
sys file system.
But when I add this lines in order to create my own attribute in directory
of my module:

#include linux/sysfs.h
#include linux/kobject.h

sysfs_create_file(device-cdev.kobj,pid_sfs);

I can not insert module. Kernel says something like this:
Error inserting module -1: unknown symbol sysfs_create_file


sysfs_create_file is only available to GPL modules. Is yours 
MODULE_LICENSE(GPL)?


Daniel

--
gentoo-dev@gentoo.org mailing list