where did class_simple_create go? alternatives? - Linux

This is a discussion on where did class_simple_create go? alternatives? - Linux ; Hi, up to quite recently there used to be a simple way to incorporate sysfs into a device (character device, in my case) without , by using the functions like "class_simple_create". http://mirror.linux.org.au/linux.con...le_create.html "This is used to create a struct class_simple ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: where did class_simple_create go? alternatives?

  1. where did class_simple_create go? alternatives?

    Hi,

    up to quite recently there used to be a simple way to incorporate sysfs
    into a device (character device, in my case) without , by using the
    functions like "class_simple_create".

    http://mirror.linux.org.au/linux.con...le_create.html

    "This is used to create a struct class_simple pointer that can then be
    used in calls to class_simple_device_add. This is used when you do not
    wish to create a full blown class support for a type of char devices."

    What happened to these?

    Does anyone know what is currently (kernel 2.6.16) the easiest way to do
    this, without adding full blown class support?

    I already tried to search LKML and kernel.org plus fgrep'ping kernel
    sources, but couldn't find any info. Maybe someone can help?

    'ffing moving target, the kernel... !#%

    many thanks,
    - Jan

  2. Re: where did class_simple_create go? alternatives?

    Jan Wagner wrote:
    > up to quite recently there used to be a simple way to incorporate sysfs
    > into a device (character device, in my case) without , by using the
    > functions like "class_simple_create".
    >
    > http://mirror.linux.org.au/linux.con...le_create.html
    >
    >
    > "This is used to create a struct class_simple pointer that can then be
    > used in calls to class_simple_device_add. This is used when you do not
    > wish to create a full blown class support for a type of char devices."
    >
    > What happened to these?


    Ok, found out that these funcs are now really missing. No information
    anywhere.

    For the record, if someone needs this at some point... pre-2.6.12 vs
    post-2.6.12 migration:

    struct class_simple *pClass;
    =>
    struct class *pClass;
    (and I'm sure someone will soon change C++ keyword 'class' of the struct
    to something else...)

    pClass = class_simple_create(THIS_MODULE, MYNAME);
    =>
    pClass = class_create(THIS_MODULE, MYNAME)

    class_simple_device_add(pClass, MKDEV(my_major, 0), NULL, MYNAME);
    =>
    class_device_create(pClass, NULL, MKDEV(my_major, 0), NULL, MYNAME);

    class_simple_device_remove(MKDEV(my_major, 0));
    class_simple_destroy(pClass);
    =>
    class_device_destroy(pClass, MKDEV(my_major, 0));
    class_destroy(pClass);

    So migration isn't that hard. But still one more annoyance preventing
    from kernel development being smooth :-(

    - Jan

+ Reply to Thread