1. NAME

device_schedule_callback_owner - helper to schedule a callback for a device

2. SYNOPSIS

int device_schedule_callback_owner(struct device *  dev , void (* func ) (struct device *), struct module *  owner );

3. ARGUMENTS

dev
    device.

func
    callback function to invoke later.

owner
    module owning the callback routine

4. DESCRIPTION

Attribute methods must not unregister themselves or their parent device (which would amount to the same thing). Attempts to do so will deadlock, since unregistration is mutually exclusive with driver callbacks.

Instead methods can call this routine, which will attempt to allocate and schedule a workqueue request to call back func with dev as its argument in the workqueueAqs process context. dev will be pinned until func returns.

This routine is usually called via the inline device_schedule_callback, which automatically sets owner to THIS_MODULE.

Returns 0 if the request was submitted, -ENOMEM if storage could not be allocated, -ENODEV if a reference to owner isnAqt available.

5. NOTE

This routine wonAqt work if CONFIG_SYSFS isnAqt set! It uses an underlying sysfs routine (since it is intended for use by attribute methods), and if sysfs isnAqt available youAqll get nothing but -ENOSYS.

6. COPYRIGHT