Generating custom kernel uevents.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux