1DEVICE_SCHEDULE_CALL(9)  Device drivers infrastructure DEVICE_SCHEDULE_CALL(9)
2
3
4

NAME

6       device_schedule_callback_owner - helper to schedule a callback for a
7       device
8

SYNOPSIS

10       int device_schedule_callback_owner(struct device * dev,
11                                          void (*func) (struct device *),
12                                          struct module * owner);
13

ARGUMENTS

15       dev
16           device.
17
18       func
19           callback function to invoke later.
20
21       owner
22           module owning the callback routine
23

DESCRIPTION

25       Attribute methods must not unregister themselves or their parent device
26       (which would amount to the same thing). Attempts to do so will
27       deadlock, since unregistration is mutually exclusive with driver
28       callbacks.
29
30       Instead methods can call this routine, which will attempt to allocate
31       and schedule a workqueue request to call back func with dev as its
32       argument in the workqueue's process context.  dev will be pinned until
33       func returns.
34
35       This routine is usually called via the inline device_schedule_callback,
36       which automatically sets owner to THIS_MODULE.
37
38       Returns 0 if the request was submitted, -ENOMEM if storage could not be
39       allocated, -ENODEV if a reference to owner isn't available.
40

NOTE

42       This routine won't work if CONFIG_SYSFS isn't set! It uses an
43       underlying sysfs routine (since it is intended for use by attribute
44       methods), and if sysfs isn't available you'll get nothing but -ENOSYS.
45
47Kernel Hackers Manual 3.10         June 2019           DEVICE_SCHEDULE_CALL(9)
Impressum