Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Namespaces | Macros | Functions
device.h File Reference
#include <linux/ioport.h>
#include <linux/kobject.h>
#include <linux/klist.h>
#include <linux/list.h>
#include <linux/lockdep.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/mutex.h>
#include <linux/pm.h>
#include <linux/atomic.h>
#include <linux/ratelimit.h>
#include <asm/device.h>
#include <linux/pm_wakeup.h>

Go to the source code of this file.

Data Structures

struct  bus_attribute
 
struct  bus_type
 
struct  subsys_dev_iter
 
struct  device_driver
 
struct  driver_attribute
 
struct  subsys_interface
 
class  class
 
struct  class_dev_iter
 
struct  class_attribute
 
struct  class_attribute_string
 
struct  class_interface
 
struct  device_type
 
struct  device_attribute
 
struct  dev_ext_attribute
 
struct  device_dma_parameters
 
class  device
 

Namespaces

namespace  Namespace
 

Macros

#define BUS_ATTR(_name, _mode, _show, _store)   struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store)
 

Functions

int __must_check bus_create_file (struct bus_type *, struct bus_attribute *)
 
void bus_remove_file (struct bus_type *, struct bus_attribute *)
 
: name of the device function

struct subsys_interface - interfaces to device functions

: subsytem of the devices to attach to : the list of functions registered at the subsystem : device hookup to device function handler : device hookup to device function handler

Simple interfaces attached to a subsystem. Multiple interfaces can attach to a subsystem and its devices. Unlike drivers, they do not exclusively claim or control devices. Interfaces usually represent a specific functionality of a subsystem/class of devices.

int subsys_interface_register (struct subsys_interface *sif)
 
void subsys_interface_unregister (struct subsys_interface *sif)
 
int subsys_system_register (struct bus_type *subsys, const struct attribute_group **groups)
 

: The name of the bus.

struct bus_type - The bus type of the device

: Used for subsystems to enumerate devices like ("foo%u", dev->id). : Default device to use as the parent. : Default attributes of the bus. : Default attributes of the devices on the bus. : Default attributes of the device drivers on the bus. : Called, perhaps multiple times, whenever a new device or driver is added for this bus. It should return a nonzero value if the given device can be handled by the given driver. : Called when a device is added, removed, or a few other things that generate uevents to add the environment variables. : Called when a new device or driver add to this bus, and callback the specific driver's probe to initial the matched device. : Called when a device removed from this bus. : Called at shut-down time to quiesce the device. : Called when a device on this bus wants to go to sleep mode. : Called to bring a device on this bus out of sleep mode. : Power management operations of this bus, callback the specific device driver's pm-ops. : IOMMU specific operations for this bus, used to attach IOMMU driver implementations to a bus and allow the driver to do bus-specific setup : The private data of the driver core, only the driver core can touch this.

A bus is a channel between the processor and one or more devices. For the purposes of the device model, all devices are connected via a bus, even if it is an internal, virtual, "platform" bus. Buses can plug into each other. A USB controller is usually a PCI device, for example. The device model represents the actual connections between buses and the devices they control. A bus is represented by the bus_type structure. It contains the name, the default attributes, the bus' methods, PM operations, and the driver core's private data.

#define bus_register(subsys)
 
#define BUS_NOTIFY_ADD_DEVICE   0x00000001 /* device added */
 
#define BUS_NOTIFY_DEL_DEVICE   0x00000002 /* device removed */
 
#define BUS_NOTIFY_BIND_DRIVER
 
#define BUS_NOTIFY_BOUND_DRIVER   0x00000004 /* driver bound to device */
 
#define BUS_NOTIFY_UNBIND_DRIVER
 
#define BUS_NOTIFY_UNBOUND_DRIVER
 
int __must_check __bus_register (struct bus_type *bus, struct lock_class_key *key)
 
void bus_unregister (struct bus_type *bus)
 
int __must_check bus_rescan_devices (struct bus_type *bus)
 
void subsys_dev_iter_init (struct subsys_dev_iter *iter, struct bus_type *subsys, struct device *start, const struct device_type *type)
 
struct devicesubsys_dev_iter_next (struct subsys_dev_iter *iter)
 
void subsys_dev_iter_exit (struct subsys_dev_iter *iter)
 
int bus_for_each_dev (struct bus_type *bus, struct device *start, void *data, int(*fn)(struct device *dev, void *data))
 
struct devicebus_find_device (struct bus_type *bus, struct device *start, void *data, int(*match)(struct device *dev, void *data))
 
struct devicebus_find_device_by_name (struct bus_type *bus, struct device *start, const char *name)
 
struct devicesubsys_find_device_by_id (struct bus_type *bus, unsigned int id, struct device *hint)
 
int bus_for_each_drv (struct bus_type *bus, struct device_driver *start, void *data, int(*fn)(struct device_driver *, void *))
 
void bus_sort_breadthfirst (struct bus_type *bus, int(*compare)(const struct device *a, const struct device *b))
 
int bus_register_notifier (struct bus_type *bus, struct notifier_block *nb)
 
int bus_unregister_notifier (struct bus_type *bus, struct notifier_block *nb)
 
struct ksetbus_get_kset (struct bus_type *bus)
 
struct klistbus_get_device_klist (struct bus_type *bus)
 

: Name of the device driver.

struct device_driver - The basic device driver structure

: The bus which the device of this driver belongs to. : The module owner. : Used for built-in modules. : Disables bind/unbind via sysfs. : The open firmware table. : Called to query the existence of a specific device, whether this driver can work with it, and bind the driver to a specific device. : Called when the device is removed from the system to unbind a device from this driver. : Called at shut-down time to quiesce the device. : Called to put the device to sleep mode. Usually to a low power state. : Called to bring a device from sleep mode. : Default attributes that get created by the driver core automatically. : Power management operations of the device which matched this driver. : Driver core's private data, no one other than the driver core can touch this.

The device driver-model tracks all of the drivers known to the system. The main reason for this tracking is to enable the driver core to match up drivers with new devices. Once drivers are known objects within the system, however, a number of other things become possible. Device drivers can export information and configuration variables that are independent of any specific device.

#define DRIVER_ATTR(_name, _mode, _show, _store)
 
int __must_check driver_register (struct device_driver *drv)
 
void driver_unregister (struct device_driver *drv)
 
struct device_driverdriver_find (const char *name, struct bus_type *bus)
 
int driver_probe_done (void)
 
void wait_for_device_probe (void)
 
int __must_check driver_create_file (struct device_driver *driver, const struct driver_attribute *attr)
 
void driver_remove_file (struct device_driver *driver, const struct driver_attribute *attr)
 
int __must_check driver_for_each_device (struct device_driver *drv, struct device *start, void *data, int(*fn)(struct device *dev, void *))
 
struct devicedriver_find_device (struct device_driver *drv, struct device *start, void *data, int(*match)(struct device *dev, void *data))
 

: Name of the class.

struct class - device classes

: The module owner. : Default attributes of this class. : Default attributes of the devices belong to the class. : Default binary attributes of the devices belong to the class. : The kobject that represents this class and links it into the hierarchy. : Called when a device is added, removed from this class, or a few other things that generate uevents to add the environment variables. : Callback to provide the devtmpfs. : Called to release this class. : Called to release the device. : Used to put the device to sleep mode, usually to a low power state. : Used to bring the device from the sleep mode. : Callbacks so sysfs can detemine namespaces.

#define class_register(class)
 
#define CLASS_ATTR(_name, _mode, _show, _store)   struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store)
 
#define _CLASS_ATTR_STRING(_name, _mode, _str)   { __ATTR(_name, _mode, show_class_attr_string, NULL), _str }
 
#define CLASS_ATTR_STRING(_name, _mode, _str)
 
#define class_create(owner, name)
 
#define DEVICE_ATTR(_name, _mode, _show, _store)   struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
 
#define DEVICE_ULONG_ATTR(_name, _mode, _var)
 
#define DEVICE_INT_ATTR(_name, _mode, _var)
 
#define DEVICE_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)
 
#define device_schedule_callback(dev, func)   device_schedule_callback_owner(dev, func, THIS_MODULE)
 
#define root_device_register(name)   __root_device_register(name, THIS_MODULE)
 
#define dev_info(dev, fmt, arg...)   _dev_info(dev, fmt, ##arg)
 
#define dev_dbg(dev, format, arg...)
 
#define dev_level_ratelimited(dev_level, dev, fmt,...)
 
#define dev_emerg_ratelimited(dev, fmt,...)   dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__)
 
#define dev_alert_ratelimited(dev, fmt,...)   dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__)
 
#define dev_crit_ratelimited(dev, fmt,...)   dev_level_ratelimited(dev_crit, dev, fmt, ##__VA_ARGS__)
 
#define dev_err_ratelimited(dev, fmt,...)   dev_level_ratelimited(dev_err, dev, fmt, ##__VA_ARGS__)
 
#define dev_warn_ratelimited(dev, fmt,...)   dev_level_ratelimited(dev_warn, dev, fmt, ##__VA_ARGS__)
 
#define dev_notice_ratelimited(dev, fmt,...)   dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)
 
#define dev_info_ratelimited(dev, fmt,...)   dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)
 
#define dev_dbg_ratelimited(dev, fmt,...)   no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 
#define dev_vdbg(dev, format, arg...)
 
#define dev_WARN(dev, format, arg...)   WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg);
 
#define dev_WARN_ONCE(dev, condition, format, arg...)
 
#define MODULE_ALIAS_CHARDEV(major, minor)   MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
 
#define MODULE_ALIAS_CHARDEV_MAJOR(major)   MODULE_ALIAS("char-major-" __stringify(major) "-*")
 
#define sysfs_deprecated   0
 
#define module_driver(__driver, __register, __unregister,...)
 
typedef void(* dr_release_t )(struct device *dev, void *res)
 
typedef int(* dr_match_t )(struct device *dev, void *res, void *match_data)
 
struct kobjectsysfs_dev_block_kobj
 
struct kobjectsysfs_dev_char_kobj
 
const charname
 
struct deviceparent
 
struct device dev_t devt
 
struct device dev_t voiddrvdata
 
struct device dev_t void const
char
fmt
 
int(* platform_notify )(struct device *dev)
 
int(* platform_notify_remove )(struct device *dev)
 
static struct devicedev
 
static struct device const
char va_list 
args { return 0
 
int __must_check __class_register (struct class *class, struct lock_class_key *key)
 
void class_unregister (struct class *class)
 
struct class_compatclass_compat_register (const char *name)
 
void class_compat_unregister (struct class_compat *cls)
 
int class_compat_create_link (struct class_compat *cls, struct device *dev, struct device *device_link)
 
void class_compat_remove_link (struct class_compat *cls, struct device *dev, struct device *device_link)
 
void class_dev_iter_init (struct class_dev_iter *iter, struct class *class, struct device *start, const struct device_type *type)
 
struct deviceclass_dev_iter_next (struct class_dev_iter *iter)
 
void class_dev_iter_exit (struct class_dev_iter *iter)
 
int class_for_each_device (struct class *class, struct device *start, void *data, int(*fn)(struct device *dev, void *data))
 
struct deviceclass_find_device (struct class *class, struct device *start, void *data, int(*match)(struct device *, void *))
 
int __must_check class_create_file (struct class *class, const struct class_attribute *attr)
 
void class_remove_file (struct class *class, const struct class_attribute *attr)
 
ssize_t show_class_attr_string (struct class *class, struct class_attribute *attr, char *buf)
 
int __must_check class_interface_register (struct class_interface *)
 
void class_interface_unregister (struct class_interface *)
 
struct class *__must_check __class_create (struct module *owner, const char *name, struct lock_class_key *key)
 
void class_destroy (struct class *cls)
 
ssize_t device_show_ulong (struct device *dev, struct device_attribute *attr, char *buf)
 
ssize_t device_store_ulong (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 
ssize_t device_show_int (struct device *dev, struct device_attribute *attr, char *buf)
 
ssize_t device_store_int (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 
int device_create_file (struct device *device, const struct device_attribute *entry)
 
void device_remove_file (struct device *dev, const struct device_attribute *attr)
 
int __must_check device_create_bin_file (struct device *dev, const struct bin_attribute *attr)
 
void device_remove_bin_file (struct device *dev, const struct bin_attribute *attr)
 
int device_schedule_callback_owner (struct device *dev, void(*func)(struct device *dev), struct module *owner)
 
voiddevres_alloc (dr_release_t release, size_t size, gfp_t gfp)
 
void devres_for_each_res (struct device *dev, dr_release_t release, dr_match_t match, void *match_data, void(*fn)(struct device *, void *, void *), void *data)
 
void devres_free (void *res)
 
void devres_add (struct device *dev, void *res)
 
voiddevres_find (struct device *dev, dr_release_t release, dr_match_t match, void *match_data)
 
voiddevres_get (struct device *dev, void *new_res, dr_match_t match, void *match_data)
 
voiddevres_remove (struct device *dev, dr_release_t release, dr_match_t match, void *match_data)
 
int devres_destroy (struct device *dev, dr_release_t release, dr_match_t match, void *match_data)
 
int devres_release (struct device *dev, dr_release_t release, dr_match_t match, void *match_data)
 
void *__must_check devres_open_group (struct device *dev, void *id, gfp_t gfp)
 
void devres_close_group (struct device *dev, void *id)
 
void devres_remove_group (struct device *dev, void *id)
 
int devres_release_group (struct device *dev, void *id)
 
voiddevm_kzalloc (struct device *dev, size_t size, gfp_t gfp)
 
void devm_kfree (struct device *dev, void *p)
 
void __iomemdevm_request_and_ioremap (struct device *dev, struct resource *res)
 
 __printf (2, 3) int dev_set_name(struct device *dev
 
void driver_init (void)
 
int __must_check device_register (struct device *dev)
 
void device_unregister (struct device *dev)
 
void device_initialize (struct device *dev)
 
int __must_check device_add (struct device *dev)
 
void device_del (struct device *dev)
 
int device_for_each_child (struct device *dev, void *data, int(*fn)(struct device *dev, void *data))
 
struct devicedevice_find_child (struct device *dev, void *data, int(*match)(struct device *dev, void *data))
 
int device_rename (struct device *dev, const char *new_name)
 
int device_move (struct device *dev, struct device *new_parent, enum dpm_order dpm_order)
 
const chardevice_get_devnode (struct device *dev, umode_t *mode, const char **tmp)
 
voiddev_get_drvdata (const struct device *dev)
 
int dev_set_drvdata (struct device *dev, void *data)
 
struct device__root_device_register (const char *name, struct module *owner)
 
void root_device_unregister (struct device *root)
 
int __must_check device_bind_driver (struct device *dev)
 
void device_release_driver (struct device *dev)
 
int __must_check device_attach (struct device *dev)
 
int __must_check driver_attach (struct device_driver *drv)
 
int __must_check device_reprobe (struct device *dev)
 
struct devicedevice_create_vargs (struct class *cls, struct device *parent, dev_t devt, void *drvdata, const char *fmt, va_list vargs)
 
 __printf (5, 6) struct device *device_create(struct class *cls
 
struct device dev_t void const
char void 
device_destroy (struct class *cls, dev_t devt)
 
struct deviceget_device (struct device *dev)
 
void put_device (struct device *dev)
 
void device_shutdown (void)
 
const chardev_driver_string (const struct device *dev)
 

Macro Definition Documentation

#define _CLASS_ATTR_STRING (   _name,
  _mode,
  _str 
)    { __ATTR(_name, _mode, show_class_attr_string, NULL), _str }

Definition at line 422 of file device.h.

#define BUS_ATTR (   _name,
  _mode,
  _show,
  _store 
)    struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store)

Definition at line 47 of file device.h.

#define BUS_NOTIFY_ADD_DEVICE   0x00000001 /* device added */

Definition at line 172 of file device.h.

#define BUS_NOTIFY_BIND_DRIVER
Value:
0x00000003 /* driver about to be
bound */

Definition at line 174 of file device.h.

#define BUS_NOTIFY_BOUND_DRIVER   0x00000004 /* driver bound to device */

Definition at line 175 of file device.h.

#define BUS_NOTIFY_DEL_DEVICE   0x00000002 /* device removed */

Definition at line 173 of file device.h.

#define BUS_NOTIFY_UNBIND_DRIVER
Value:
0x00000005 /* driver about to be
unbound */

Definition at line 176 of file device.h.

#define BUS_NOTIFY_UNBOUND_DRIVER
Value:
0x00000006 /* driver is unbound
from the device */

Definition at line 177 of file device.h.

#define bus_register (   subsys)
Value:
({ \
static struct lock_class_key __key; \
__bus_register(subsys, &__key); \
})

Definition at line 117 of file device.h.

#define CLASS_ATTR (   _name,
  _mode,
  _show,
  _store 
)    struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store)

Definition at line 406 of file device.h.

#define CLASS_ATTR_STRING (   _name,
  _mode,
  _str 
)
Value:
struct class_attribute_string class_attr_##_name = \
_CLASS_ATTR_STRING(_name, _mode, _str)

Definition at line 424 of file device.h.

#define class_create (   owner,
  name 
)
Value:
({ \
static struct lock_class_key __key; \
__class_create(owner, name, &__key); \
})

Definition at line 449 of file device.h.

#define class_register (   class)
Value:
({ \
static struct lock_class_key __key; \
__class_register(class, &__key); \
})

Definition at line 368 of file device.h.

#define dev_alert_ratelimited (   dev,
  fmt,
  ... 
)    dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__)

Definition at line 1005 of file device.h.

#define dev_crit_ratelimited (   dev,
  fmt,
  ... 
)    dev_level_ratelimited(dev_crit, dev, fmt, ##__VA_ARGS__)

Definition at line 1007 of file device.h.

#define dev_dbg (   dev,
  format,
  arg... 
)
Value:
({ \
if (0) \
dev_printk(KERN_DEBUG, dev, format, ##arg); \
0; \
})

Definition at line 986 of file device.h.

#define dev_dbg_ratelimited (   dev,
  fmt,
  ... 
)    no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 1030 of file device.h.

#define dev_emerg_ratelimited (   dev,
  fmt,
  ... 
)    dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__)

Definition at line 1003 of file device.h.

#define dev_err_ratelimited (   dev,
  fmt,
  ... 
)    dev_level_ratelimited(dev_err, dev, fmt, ##__VA_ARGS__)

Definition at line 1009 of file device.h.

#define dev_info (   dev,
  fmt,
  arg... 
)    _dev_info(dev, fmt, ##arg)

Definition at line 975 of file device.h.

#define dev_info_ratelimited (   dev,
  fmt,
  ... 
)    dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)

Definition at line 1015 of file device.h.

#define dev_level_ratelimited (   dev_level,
  dev,
  fmt,
  ... 
)
Value:
do { \
static DEFINE_RATELIMIT_STATE(_rs, \
if (__ratelimit(&_rs)) \
dev_level(dev, fmt, ##__VA_ARGS__); \
} while (0)

Definition at line 994 of file device.h.

#define dev_notice_ratelimited (   dev,
  fmt,
  ... 
)    dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)

Definition at line 1013 of file device.h.

#define dev_vdbg (   dev,
  format,
  arg... 
)
Value:
({ \
if (0) \
dev_printk(KERN_DEBUG, dev, format, ##arg); \
0; \
})

Definition at line 1037 of file device.h.

#define dev_WARN (   dev,
  format,
  arg... 
)    WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg);

Definition at line 1050 of file device.h.

#define dev_WARN_ONCE (   dev,
  condition,
  format,
  arg... 
)
Value:
WARN_ONCE(condition, "Device %s\n" format, \

Definition at line 1053 of file device.h.

#define dev_warn_ratelimited (   dev,
  fmt,
  ... 
)    dev_level_ratelimited(dev_warn, dev, fmt, ##__VA_ARGS__)

Definition at line 1011 of file device.h.

#define DEVICE_ATTR (   _name,
  _mode,
  _show,
  _store 
)    struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)

Definition at line 497 of file device.h.

#define DEVICE_ATTR_IGNORE_LOCKDEP (   _name,
  _mode,
  _show,
  _store 
)
Value:
struct device_attribute dev_attr_##_name = \
__ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)

Definition at line 505 of file device.h.

#define DEVICE_INT_ATTR (   _name,
  _mode,
  _var 
)
Value:
struct dev_ext_attribute dev_attr_##_name = \
{ __ATTR(_name, _mode, device_show_int, device_store_int), &(_var) }

Definition at line 502 of file device.h.

#define device_schedule_callback (   dev,
  func 
)    device_schedule_callback_owner(dev, func, THIS_MODULE)

Definition at line 521 of file device.h.

#define DEVICE_ULONG_ATTR (   _name,
  _mode,
  _var 
)
Value:
struct dev_ext_attribute dev_attr_##_name = \
{ __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }

Definition at line 499 of file device.h.

#define DRIVER_ATTR (   _name,
  _mode,
  _show,
  _store 
)
Value:
struct driver_attribute driver_attr_##_name = \
__ATTR(_name, _mode, _show, _store)

Definition at line 255 of file device.h.

#define MODULE_ALIAS_CHARDEV (   major,
  minor 
)    MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))

Definition at line 1058 of file device.h.

#define MODULE_ALIAS_CHARDEV_MAJOR (   major)    MODULE_ALIAS("char-major-" __stringify(major) "-*")

Definition at line 1060 of file device.h.

#define module_driver (   __driver,
  __register,
  __unregister,
  ... 
)
Value:
static int __init __driver##_init(void) \
{ \
return __register(&(__driver) , ##__VA_ARGS__); \
} \
module_init(__driver##_init); \
static void __exit __driver##_exit(void) \
{ \
__unregister(&(__driver) , ##__VA_ARGS__); \
} \
module_exit(__driver##_exit);

module_driver() - Helper macro for drivers that don't do anything special in module init/exit. This eliminates a lot of boilerplate. Each module may only use this macro once, and calling it replaces module_init() and module_exit().

: driver name : register function for this driver type : unregister function for this driver type ..: Additional arguments to be passed to __register and __unregister.

Use this macro to construct bus specific macros for registering drivers, and do not use it on its own.

Definition at line 1083 of file device.h.

#define root_device_register (   name)    __root_device_register(name, THIS_MODULE)

Definition at line 830 of file device.h.

#define sysfs_deprecated   0

Definition at line 1066 of file device.h.

Typedef Documentation

typedef int(* dr_match_t)(struct device *dev, void *res, void *match_data)

Definition at line 526 of file device.h.

typedef void(* dr_release_t)(struct device *dev, void *res)

Definition at line 525 of file device.h.

Function Documentation

int __must_check __bus_register ( struct bus_type bus,
struct lock_class_key key 
)

__bus_register - register a driver-core subsystem : bus to register : lockdep class key

Once we have that, we register the bus with the kobject infrastructure, then register the children subsystems it has: the devices and drivers that belong to the subsystem.

Definition at line 923 of file bus.c.

struct class* __must_check __class_create ( struct module owner,
const char name,
struct lock_class_key key 
)
read

Definition at line 249 of file class.c.

int __must_check __class_register ( struct class class,
struct lock_class_key key 
)

Definition at line 176 of file class.c.

__printf ( ,
 
)
__printf ( ,
 
)
struct device* __root_device_register ( const char name,
struct module owner 
)
read

Definition at line 1434 of file core.c.

int __must_check bus_create_file ( struct bus_type ,
struct bus_attribute  
)

Definition at line 127 of file bus.c.

struct device* bus_find_device ( struct bus_type bus,
struct device start,
void data,
int(*)(struct device *dev, void *data match 
)
read

bus_find_device - device iterator for locating a particular device. : bus type : Device to begin with : Data to pass to match function : Callback function to check device

This is similar to the bus_for_each_dev() function above, but it returns a reference to a device that is 'found' for later use, as determined by the callback.

The callback should return 0 if the device doesn't match and non-zero if it does. If the callback returns non-zero, this function will return to the caller and not iterate over any more devices.

Definition at line 323 of file bus.c.

struct device* bus_find_device_by_name ( struct bus_type bus,
struct device start,
const char name 
)
read

Definition at line 360 of file bus.c.

int bus_for_each_dev ( struct bus_type bus,
struct device start,
void data,
int(*)(struct device *dev, void *data fn 
)
int bus_for_each_drv ( struct bus_type bus,
struct device_driver start,
void data,
int(*)(struct device_driver *, void *)  fn 
)

Definition at line 439 of file bus.c.

struct klist* bus_get_device_klist ( struct bus_type bus)
read

Definition at line 1041 of file bus.c.

struct kset* bus_get_kset ( struct bus_type bus)
read

Definition at line 1035 of file bus.c.

int bus_register_notifier ( struct bus_type bus,
struct notifier_block nb 
)

Definition at line 1023 of file bus.c.

void bus_remove_file ( struct bus_type ,
struct bus_attribute  
)

Definition at line 139 of file bus.c.

int __must_check bus_rescan_devices ( struct bus_type bus)

bus_rescan_devices - rescan devices on the bus for possible drivers : the bus to scan.

This function will look for devices on the bus with no driver attached and rescan it against existing drivers to see if it matches any by calling device_attach() for the unbound devices.

Definition at line 806 of file bus.c.

void bus_sort_breadthfirst ( struct bus_type bus,
int(*)(const struct device *a, const struct device *b compare 
)

Definition at line 1076 of file bus.c.

void bus_unregister ( struct bus_type bus)

bus_unregister - remove a bus from the system : bus.

Unregister the child subsystems and the bus itself. Finally, we call bus_put() to release the refcount

Definition at line 1007 of file bus.c.

int bus_unregister_notifier ( struct bus_type bus,
struct notifier_block nb 
)

Definition at line 1029 of file bus.c.

int class_compat_create_link ( struct class_compat cls,
struct device dev,
struct device device_link 
)

class_compat_create_link - create a compatibility class device link to a bus device : the compatibility class : the target bus device : an optional device to which a "device" link should be created

Definition at line 553 of file class.c.

struct class_compat* class_compat_register ( const char name)
read

Definition at line 519 of file class.c.

void class_compat_remove_link ( struct class_compat cls,
struct device dev,
struct device device_link 
)

class_compat_remove_link - remove a compatibility class device link to a bus device : the compatibility class : the target bus device : an optional device to which a "device" link was previously created

Definition at line 586 of file class.c.

void class_compat_unregister ( struct class_compat cls)

class_compat_unregister - unregister a compatibility class : the class to unregister

Definition at line 539 of file class.c.

int __must_check class_create_file ( struct class class,
const struct class_attribute attr 
)

Definition at line 102 of file class.c.

void class_destroy ( struct class cls)

class_destroy - destroys a struct class structure : pointer to the struct class that is to be destroyed

Note, the pointer to be destroyed must have been created with a call to class_create().

Definition at line 284 of file class.c.

void class_dev_iter_exit ( struct class_dev_iter iter)

class_dev_iter_exit - finish iteration : class iterator to finish

Finish an iteration. Always call this function after iteration is complete whether the iteration ran till the end or not.

Definition at line 351 of file class.c.

void class_dev_iter_init ( struct class_dev_iter iter,
struct class class,
struct device start,
const struct device_type type 
)

Definition at line 304 of file class.c.

struct device* class_dev_iter_next ( struct class_dev_iter iter)
read

class_dev_iter_next - iterate to the next device : class iterator to proceed

Proceed to the next device and return it. Returns NULL if iteration is complete.

The returned device is referenced and won't be released till iterator is proceed to the next device or exited. The caller is free to do whatever it wants to do with the device including calling back into class code.

Definition at line 328 of file class.c.

struct device* class_find_device ( struct class class,
struct device start,
void data,
int(*)(struct device *, void *)  match 
)
read

Definition at line 422 of file class.c.

int class_for_each_device ( struct class class,
struct device start,
void data,
int(*)(struct device *dev, void *data fn 
)
int __must_check class_interface_register ( struct class_interface )

Definition at line 450 of file class.c.

void class_interface_unregister ( struct class_interface )

Definition at line 476 of file class.c.

void class_remove_file ( struct class class,
const struct class_attribute attr 
)

Definition at line 113 of file class.c.

void class_unregister ( struct class class)

Definition at line 222 of file class.c.

const char* dev_driver_string ( const struct device dev)

dev_driver_string - Return a device's driver name, if at all possible : struct device to get the name of

Will return the device's driver's name if it is bound to a device. If the device is not bound to a driver, it will return the name of the bus it is attached to. If it is not attached to a bus either, an empty string will be returned.

Definition at line 73 of file core.c.

void* dev_get_drvdata ( const struct device dev)

Definition at line 569 of file dd.c.

int dev_set_drvdata ( struct device dev,
void data 
)

Definition at line 577 of file dd.c.

int __must_check device_add ( struct device dev)

device_add - add device to device hierarchy. : device.

This is part 2 of device_register(), though may be called separately iff device_initialize() has been called separately.

This adds to the kobject hierarchy via kobject_add(), adds it to the global and sibling lists for the device, then adds it to the other relevant subsystems of the driver model.

Do not call this routine or device_register() more than once for any device structure. The driver model core is not designed to work with devices that get unregistered and then spring back to life. (Among other things, it's very hard to guarantee that all references to the previous incarnation of have been dropped.) Allocate and register a fresh new struct device instead.

NOTE: Never directly free after calling this function, even if it returned an error! Always use put_device() to give up your reference instead.

Definition at line 966 of file core.c.

int __must_check device_attach ( struct device dev)

device_attach - try to attach device to a driver. : device.

Walk the list of drivers that the bus has and call driver_probe_device() for each pair. If a compatible pair is found, break out and return.

Returns 1 if the device was bound to a driver; 0 if no matching driver was found; -ENODEV if the device is not registered.

When called for a USB interface, ->parent lock must be held.

Definition at line 403 of file dd.c.

int __must_check device_bind_driver ( struct device dev)

device_bind_driver - bind a driver to one device. : device.

Allow manual attachment of a driver to a device. Caller must have already set ->driver.

Note that this does not modify the bus reference count nor take the bus's rwsem. Please verify those are accounted for before calling this. (It is ok to call with no other effort from a driver's probe() method.)

This function must be called with the device lock held.

Definition at line 248 of file dd.c.

int __must_check device_create_bin_file ( struct device dev,
const struct bin_attribute attr 
)

device_create_bin_file - create sysfs binary attribute file for device. : device. : device binary attribute descriptor.

Definition at line 567 of file core.c.

int device_create_file ( struct device dev,
const struct device_attribute attr 
)

device_create_file - create sysfs attribute file for device. : device. : device attribute descriptor.

Definition at line 541 of file core.c.

struct device* device_create_vargs ( struct class cls,
struct device parent,
dev_t  devt,
void drvdata,
const char fmt,
va_list  vargs 
)
read

Definition at line 1524 of file core.c.

void device_del ( struct device dev)

device_del - delete device from system. : device.

This is the first part of the device unregistration sequence. This removes the device from the lists we control from here, has it removed from the other driver model subsystems it was added to in device_add(), and removes it from the kobject hierarchy.

NOTE: this should be called manually iff device_add() was also called manually.

Definition at line 1172 of file core.c.

struct device dev_t void const char void device_destroy ( struct class cls,
dev_t  devt 
)

Definition at line 1614 of file core.c.

struct device* device_find_child ( struct device parent,
void data,
int(*)(struct device *dev, void *data match 
)
read

device_find_child - device iterator for locating a particular device. : parent struct device : Data to pass to match function : Callback function to check device

This is similar to the device_for_each_child() function above, but it returns a reference to a device that is 'found' for later use, as determined by the callback.

The callback should return 0 if the device doesn't match and non-zero if it does. If the callback returns non-zero and a reference to the current device can be obtained, this function will return to the caller and not iterate over any more devices.

Definition at line 1339 of file core.c.

int device_for_each_child ( struct device dev,
void data,
int(*)(struct device *dev, void *data fn 
)

Definition at line 1307 of file core.c.

const char* device_get_devnode ( struct device dev,
umode_t mode,
const char **  tmp 
)

device_get_devnode - path of device node file : device : returned file access mode : possibly allocated string

Return the relative path of a possible device node. Non-default names may need to allocate a memory to compose a name. This memory is returned in tmp and needs to be freed by the caller.

Definition at line 1263 of file core.c.

void device_initialize ( struct device dev)

device_initialize - init device structure. : device.

This prepares the device for use by other layers by initializing its fields. It is the first half of device_register(), if called by that function, though it can also be called separately, so one may use 's fields. In particular, get_device()/put_device() may be used for reference counting of after calling this function.

All fields in must be initialized by the caller to 0, except for those explicitly set to some other value. The simplest approach is to use kzalloc() to allocate the structure containing .

NOTE: Use put_device() to give up your reference instead of freeing directly once you have called this function.

Definition at line 659 of file core.c.

int device_move ( struct device dev,
struct device new_parent,
enum dpm_order dpm_order   
)

device_move - moves a device to a new parent : the pointer to the struct device to be moved : the new parent of the device (can by NULL) : how to reorder the dpm_list

Definition at line 1727 of file core.c.

int __must_check device_register ( struct device dev)

device_register - register a device with the system. : pointer to the device structure

This happens in two clean steps - initialize the device and add it to the system. The two steps can be called separately, but this is the easiest and most common. I.e. you should only call the two helpers separately if have a clearly defined need to use and refcount the device before it is added to the hierarchy.

For more information, see the kerneldoc for device_initialize() and device_add().

NOTE: Never directly free after calling this function, even if it returned an error! Always use put_device() to give up the reference initialized in this function instead.

Definition at line 1129 of file core.c.

void device_release_driver ( struct device dev)

device_release_driver - manually detach device from driver. : device.

Manually detach device from driver. When called for a USB interface, ->parent lock must be held.

Definition at line 518 of file dd.c.

void device_remove_bin_file ( struct device dev,
const struct bin_attribute attr 
)

device_remove_bin_file - remove sysfs binary attribute file : device. : device binary attribute descriptor.

Definition at line 582 of file core.c.

void device_remove_file ( struct device dev,
const struct device_attribute attr 
)

device_remove_file - remove sysfs attribute file. : device. : device attribute descriptor.

Definition at line 555 of file core.c.

int device_rename ( struct device dev,
const char new_name 
)

device_rename - renames a device : the pointer to the struct device to be renamed : the new name of the device

It is the responsibility of the caller to provide mutual exclusion between two different calls of device_rename on the same device to ensure that new_name is valid and won't conflict with other devices.

Note: Don't call this function. Currently, the networking layer calls this function, but that will change. The following text from Kay Sievers offers some insight:

Renaming devices is racy at many levels, symlinks and other stuff are not replaced atomically, and you get a "move" uevent, but it's not easy to connect the event to the old and new device. Device nodes are not renamed at all, there isn't even support for that in the kernel now.

In the meantime, during renaming, your target name might be taken by another driver, creating conflicts. Or the old name is taken directly after you renamed it – then you get events for the same DEVPATH, before you even see the "move" event. It's just a mess, and nothing new should ever rely on kernel device renaming. Besides that, it's not even implemented now for other things than (driver-core wise very simple) network devices.

We are currently about to change network renaming in udev to completely disallow renaming of devices in the same namespace as the kernel uses, because we can't solve the problems properly, that arise with swapping names of multiple interfaces without races. Means, renaming of eth[0-9]* will only be allowed to some other name than eth[0-9]*, for the aforementioned reasons.

Make up a "real" name in the driver before you register anything, or add some other attributes for userspace to find the device, or use udev to add symlinks – but never rename kernel devices later, it's a complete mess. We don't even want to get into that and try to implement the missing pieces in the core. We really have other pieces to fix in the driver core mess. :)

Definition at line 1665 of file core.c.

int __must_check device_reprobe ( struct device dev)

device_reprobe - remove driver for a device and probe for a new driver : the device to reprobe

This function detaches the attached driver (if any) for the given device and restarts the driver probing process. It is intended to use if probing criteria changed during a devices lifetime and driver attachment should change accordingly.

Definition at line 821 of file bus.c.

int device_schedule_callback_owner ( struct device dev,
void(*)(struct device *dev func,
struct module owner 
)
ssize_t device_show_int ( struct device dev,
struct device_attribute attr,
char buf 
)

Definition at line 164 of file core.c.

ssize_t device_show_ulong ( struct device dev,
struct device_attribute attr,
char buf 
)

Definition at line 140 of file core.c.

void device_shutdown ( void  )

device_shutdown - call ->shutdown() on each device to shutdown.

Definition at line 1805 of file core.c.

ssize_t device_store_int ( struct device dev,
struct device_attribute attr,
const char buf,
size_t  count 
)

Definition at line 149 of file core.c.

ssize_t device_store_ulong ( struct device dev,
struct device_attribute attr,
const char buf,
size_t  count 
)

Definition at line 125 of file core.c.

void device_unregister ( struct device dev)

device_unregister - unregister device from system. : device going away.

We do this in two parts, like we do device_register(). First, we remove it from all the subsystems with device_del(), then we decrement the reference count via put_device(). If that is the final reference count, the device will be cleaned up via device_release() above. Otherwise, the structure will stick around until the final reference to the device is dropped.

Definition at line 1232 of file core.c.

void devm_kfree ( struct device dev,
void p 
)

devm_kfree - Resource-managed kfree : Device this memory belongs to : Memory to free

Free memory allocated with devm_kzalloc().

Definition at line 721 of file devres.c.

void* devm_kzalloc ( struct device dev,
size_t  size,
gfp_t  gfp 
)

devm_kzalloc - Resource-managed kzalloc : Device to allocate memory for : Allocation size : Allocation gfp flags

Managed kzalloc. Memory allocated with this function is automatically freed on driver detach. Like all other devres resources, guaranteed alignment is unsigned long long.

RETURNS: Pointer to allocated memory on success, NULL on failure.

Definition at line 699 of file devres.c.

void __iomem* devm_request_and_ioremap ( struct device dev,
struct resource res 
)

devm_request_and_ioremap() - Check, request region, and ioremap resource : Generic device to handle the resource for : resource to be handled

Takes all necessary steps to ioremap a mem resource. Uses managed device, so everything is undone on driver detach. Checks arguments, so you can feed it the result from e.g. platform_get_resource() directly. Returns the remapped pointer or NULL on error. Usage example:

res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_request_and_ioremap(&pdev->dev, res); if (!base) return -EADDRNOTAVAIL;

Definition at line 103 of file devres.c.

void devres_add ( struct device dev,
void res 
)

devres_add - Register device resource : Device to add resource to : Resource to register

Register devres to . should have been allocated using devres_alloc(). On driver detach, the associated release function will be invoked and devres will be freed automatically.

Definition at line 214 of file devres.c.

void* devres_alloc ( dr_release_t  release,
size_t  size,
gfp_t  gfp 
)

devres_alloc - Allocate device resource data : Release function devres will be associated with : Allocation size : Allocation flags

Allocate devres of bytes. The allocated area is zeroed, then associated with . The returned pointer can be passed to other devres_*() functions.

RETURNS: Pointer to allocated devres on success, NULL on failure.

Definition at line 134 of file devres.c.

void devres_close_group ( struct device dev,
void id 
)

devres_close_group - Close a devres group : Device to close devres group for : ID of target group, can be NULL

Close the group identified by . If is NULL, the latest open group is selected.

Definition at line 588 of file devres.c.

int devres_destroy ( struct device dev,
dr_release_t  release,
dr_match_t  match,
void match_data 
)

devres_destroy - Find a device resource and destroy it : Device to find resource from : Look for resources associated with this release function : Match function (optional) : Data for the match function

Find the latest devres of associated with and for which returns 1. If is NULL, it's considered to match all. If found, the resource is removed atomically and freed.

Note that the release function for the resource will not be called, only the devres-allocated data will be freed. The caller becomes responsible for freeing any other data.

RETURNS: 0 if devres is found and freed, -ENOENT if not found.

Definition at line 361 of file devres.c.

void* devres_find ( struct device dev,
dr_release_t  release,
dr_match_t  match,
void match_data 
)

devres_find - Find device resource : Device to lookup resource from : Look for resources associated with this release function : Match function (optional) : Data for the match function

Find the latest devres of which is associated with and for which returns 1. If is NULL, it's considered to match all.

RETURNS: Pointer to found devres, NULL if not found.

Definition at line 257 of file devres.c.

void devres_for_each_res ( struct device dev,
dr_release_t  release,
dr_match_t  match,
void match_data,
void(*)(struct device *, void *, void *)  fn,
void data 
)

Definition at line 161 of file devres.c.

void devres_free ( void res)

devres_free - Free device resource data : Pointer to devres data to free

Free devres created with devres_alloc().

Definition at line 194 of file devres.c.

void* devres_get ( struct device dev,
void new_res,
dr_match_t  match,
void match_data 
)

devres_get - Find devres, if non-existent, add one atomically : Device to lookup or add devres for : Pointer to new initialized devres to add if not found : Match function (optional) : Data for the match function

Find the latest devres of which has the same release function as and for which return 1. If found, is freed; otherwise, is added atomically.

RETURNS: Pointer to found or added devres.

Definition at line 287 of file devres.c.

void* __must_check devres_open_group ( struct device dev,
void id,
gfp_t  gfp 
)

devres_open_group - Open a new devres group : Device to open devres group for : Separator ID : Allocation flags

Open a new devres group for with . For , using a pointer to an object which won't be used for another group is recommended. If is NULL, address-wise unique ID is created.

RETURNS: ID of the new group, NULL on failure.

Definition at line 531 of file devres.c.

int devres_release ( struct device dev,
dr_release_t  release,
dr_match_t  match,
void match_data 
)

devres_release - Find a device resource and destroy it, calling release : Device to find resource from : Look for resources associated with this release function : Match function (optional) : Data for the match function

Find the latest devres of associated with and for which returns 1. If is NULL, it's considered to match all. If found, the resource is removed atomically, the release function called and the resource freed.

RETURNS: 0 if devres is found and freed, -ENOENT if not found.

Definition at line 391 of file devres.c.

int devres_release_group ( struct device dev,
void id 
)

devres_release_group - Release resources in a devres group : Device to release group for : ID of target group, can be NULL

Release all resources in the group identified by . If is NULL, the latest open group is selected. The selected group and groups properly nested inside the selected group are removed.

RETURNS: The number of released non-group resources.

Definition at line 647 of file devres.c.

void* devres_remove ( struct device dev,
dr_release_t  release,
dr_match_t  match,
void match_data 
)

devres_remove - Find a device resource and remove it : Device to find resource from : Look for resources associated with this release function : Match function (optional) : Data for the match function

Find the latest devres of associated with and for which returns 1. If is NULL, it's considered to match all. If found, the resource is removed atomically and returned.

RETURNS: Pointer to removed devres on success, NULL if not found.

Definition at line 323 of file devres.c.

void devres_remove_group ( struct device dev,
void id 
)

devres_remove_group - Remove a devres group : Device to remove group for : ID of target group, can be NULL

Remove the group identified by . If is NULL, the latest open group is selected. Note that removing a group doesn't affect any other resources.

Definition at line 614 of file devres.c.

int __must_check driver_attach ( struct device_driver drv)

driver_attach - try to bind driver to devices. : driver.

Walk the list of devices that the bus has on it and try to match the driver with each one. If driver_probe_device() returns 0 and the ->driver is set, we've found a compatible pair.

Definition at line 468 of file dd.c.

int __must_check driver_create_file ( struct device_driver drv,
const struct driver_attribute attr 
)

driver_create_file - create sysfs file for driver. : driver. : driver attribute descriptor.

Definition at line 101 of file driver.c.

struct device_driver* driver_find ( const char name,
struct bus_type bus 
)
read

Definition at line 227 of file driver.c.

struct device* driver_find_device ( struct device_driver drv,
struct device start,
void data,
int(*)(struct device *dev, void *data match 
)
read

driver_find_device - device iterator for locating a particular device. : The device's driver : Device to begin with : Data to pass to match function : Callback function to check device

This is similar to the driver_for_each_device() function above, but it returns a reference to a device that is 'found' for later use, as determined by the callback.

The callback should return 0 if the device doesn't match and non-zero if it does. If the callback returns non-zero, this function will return to the caller and not iterate over any more devices.

Definition at line 76 of file driver.c.

int __must_check driver_for_each_device ( struct device_driver drv,
struct device start,
void data,
int(*)(struct device *dev, void *)  fn 
)
void driver_init ( void  )

driver_init - initialize driver model.

Call the driver model init functions to initialize their subsystems. Called early from init/main.c.

Definition at line 20 of file init.c.

int driver_probe_done ( void  )

driver_probe_done Determine if the probe sequence is finished or not.

Should somehow figure out how to use a semaphore, not an atomic variable...

Definition at line 330 of file dd.c.

int __must_check driver_register ( struct device_driver drv)

driver_register - register driver with bus : driver to register

We pass off most of the work to the bus_add_driver() call, since most of the things we have to do deal with the bus structures.

Definition at line 164 of file driver.c.

void driver_remove_file ( struct device_driver drv,
const struct driver_attribute attr 
)

driver_remove_file - remove sysfs file for driver. : driver. : driver attribute descriptor.

Definition at line 118 of file driver.c.

void driver_unregister ( struct device_driver drv)

driver_unregister - remove driver from system. : driver.

Again, we pass off most of the work to the bus-level call.

Definition at line 204 of file driver.c.

struct device* get_device ( struct device dev)
read

get_device - increment reference count for device. : device.

This simply forwards the call to kobject_get(), though we do take care to provide for the case that we get a NULL pointer passed in.

Definition at line 1143 of file core.c.

void put_device ( struct device dev)

put_device - decrement reference count. : device in question.

Definition at line 1152 of file core.c.

void root_device_unregister ( struct device dev)

root_device_unregister - unregister and free a root device : device going away

This function unregisters and cleans up a device that was created by root_device_register().

Definition at line 1481 of file core.c.

ssize_t show_class_attr_string ( struct class class,
struct class_attribute attr,
char buf 
)

Definition at line 498 of file class.c.

void subsys_dev_iter_exit ( struct subsys_dev_iter iter)

subsys_dev_iter_exit - finish iteration : subsys iterator to finish

Finish an iteration. Always call this function after iteration is complete whether the iteration ran till the end or not.

Definition at line 1160 of file bus.c.

void subsys_dev_iter_init ( struct subsys_dev_iter iter,
struct bus_type subsys,
struct device start,
const struct device_type type 
)

subsys_dev_iter_init - initialize subsys device iterator : subsys iterator to initialize : the subsys we wanna iterate over : the device to start iterating from, if any : device_type of the devices to iterate over, NULL for all

Initialize subsys iterator such that it iterates over devices of . If is set, the list iteration will start there, otherwise if it is NULL, the iteration starts at the beginning of the list.

Definition at line 1113 of file bus.c.

struct device* subsys_dev_iter_next ( struct subsys_dev_iter iter)
read

subsys_dev_iter_next - iterate to the next device : subsys iterator to proceed

Proceed to the next device and return it. Returns NULL if iteration is complete.

The returned device is referenced and won't be released till iterator is proceed to the next device or exited. The caller is free to do whatever it wants to do with the device including calling back into subsys code.

Definition at line 1137 of file bus.c.

struct device* subsys_find_device_by_id ( struct bus_type subsys,
unsigned int  id,
struct device hint 
)
read

subsys_find_device_by_id - find a device with a specific enumeration number : subsystem : index 'id' in struct device : device to check first

Check the hint's next object and if it is a match return it directly, otherwise, fall back to a full list search. Either way a reference for the returned object is taken.

Definition at line 377 of file bus.c.

int subsys_interface_register ( struct subsys_interface sif)

Definition at line 1166 of file bus.c.

void subsys_interface_unregister ( struct subsys_interface sif)

Definition at line 1193 of file bus.c.

int subsys_system_register ( struct bus_type subsys,
const struct attribute_group **  groups 
)

subsys_system_register - register a subsystem at /sys/devices/system/ : system subsystem : default attributes for the root device

All 'system' subsystems have a /sys/devices/system/<name> root device with the name of the subsystem. The root device can carry subsystem- wide attributes. All registered devices are below this single root device and are named after the subsystem with a simple enumeration number appended. The registered devices are not explicitely named; only 'id' in the device needs to be set.

Do not use this interface for anything new, it exists for compatibility with bad ideas only. New subsystems should use plain subsystems; and add the subsystem-wide attributes should be added to the subsystem directory itself and not some create fake root-device placed in /sys/devices/system/<name>.

Definition at line 1240 of file bus.c.

void wait_for_device_probe ( void  )

wait_for_device_probe Wait for device probing to be completed.

Definition at line 343 of file dd.c.

Variable Documentation

Definition at line 931 of file device.h.

struct device* dev

Definition at line 929 of file device.h.

Definition at line 860 of file device.h.

struct device dev_t void* drvdata

Definition at line 860 of file device.h.

struct device const char static const char static const char static const char static const char static const char static const char static const char* fmt

Definition at line 860 of file device.h.

const char* name

Definition at line 713 of file device.h.

struct device* parent

Definition at line 860 of file device.h.

int(* platform_notify)(struct device *dev)

Definition at line 46 of file core.c.

int(* platform_notify_remove)(struct device *dev)

Definition at line 47 of file core.c.

struct kobject* sysfs_dev_block_kobj

Definition at line 50 of file core.c.

struct kobject* sysfs_dev_char_kobj

Definition at line 49 of file core.c.