Hello ,

I want to generate custom kernel events. This events will be
interpreted by the udev in user space.

Is the following code in the spirit of linux device model?
Am I allowed to access kobject from pdev->dev?


//..snippet

static struct platform_device *pdev;

static int __init myinit(void)
{
        char *envp[] = {
                "FOO=BAR",
                NULL
        };


        pdev = platform_device_register_simple("my_device", -1, NULL, 0);

        if (IS_ERR(pdev))
                return PTR_ERR(pdev);

        /* generate events */
        kobject_uevent_env(&pdev->dev.kobj, KOBJ_ONLINE, envp);
        return 0;
}


static void __exit myexit(void)
{
        platform_device_unregister(pdev);

}

thanks,
Daniel.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to