Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
base.h File Reference
#include <linux/notifier.h>

Go to the source code of this file.

Data Structures

struct  subsys_private
struct  driver_private
struct  device_private


#define to_subsys_private(obj)   container_of(obj, struct subsys_private, subsys.kobj)
#define to_driver(obj)   container_of(obj, struct driver_private, kobj)
#define to_device_private_parent(obj)   container_of(obj, struct device_private, knode_parent)
#define to_device_private_driver(obj)   container_of(obj, struct device_private, knode_driver)
#define to_device_private_bus(obj)   container_of(obj, struct device_private, knode_bus)


int device_private_init (struct device *dev)
int devices_init (void)
int buses_init (void)
int classes_init (void)
int firmware_init (void)
int platform_bus_init (void)
void cpu_dev_init (void)
int bus_add_device (struct device *dev)
void bus_probe_device (struct device *dev)
void bus_remove_device (struct device *dev)
int bus_add_driver (struct device_driver *drv)
void bus_remove_driver (struct device_driver *drv)
void driver_detach (struct device_driver *drv)
int driver_probe_device (struct device_driver *drv, struct device *dev)
void driver_deferred_probe_del (struct device *dev)
charmake_class_name (const char *name, struct kobject *kobj)
int devres_release_all (struct device *dev)


struct ksetdevices_kset

Macro Definition Documentation

#define to_device_private_bus (   obj)    container_of(obj, struct device_private, knode_bus)

Definition at line 86 of file base.h.

#define to_device_private_driver (   obj)    container_of(obj, struct device_private, knode_driver)

Definition at line 84 of file base.h.

#define to_device_private_parent (   obj)    container_of(obj, struct device_private, knode_parent)

Definition at line 82 of file base.h.

#define to_driver (   obj)    container_of(obj, struct driver_private, kobj)

Definition at line 53 of file base.h.

#define to_subsys_private (   obj)    container_of(obj, struct subsys_private, subsys.kobj)

Definition at line 44 of file base.h.

Function Documentation

int bus_add_device ( struct device dev)

bus_add_device - add device to bus : device being added

  • Add device's bus attributes.
  • Create links to device's bus.
  • Add the device to its bus's list of devices.

Definition at line 495 of file bus.c.

int bus_add_driver ( struct device_driver drv)

bus_add_driver - Add a driver to the bus. : driver.

Definition at line 691 of file bus.c.

void bus_probe_device ( struct device dev)

bus_probe_device - probe drivers for a new device : device to probe

  • Automatically probe for a driver if the bus allows it.

Definition at line 532 of file bus.c.

void bus_remove_device ( struct device dev)

bus_remove_device - remove device from bus : device to be removed

  • Remove device from all interfaces.
  • Remove symlink from bus' directory.
  • Delete device from bus's list.
  • Detach from its driver.
  • Drop reference taken in bus_add_device().

Definition at line 563 of file bus.c.

void bus_remove_driver ( struct device_driver drv)

bus_remove_driver - delete driver from bus's knowledge. : driver.

Detach the driver from the devices it controls, and remove it from its bus's list of drivers. Finally, we drop the reference to the bus we took in bus_add_driver().

Definition at line 765 of file bus.c.

int buses_init ( void  )

Definition at line 1282 of file bus.c.

int classes_init ( void  )

Definition at line 595 of file class.c.

void cpu_dev_init ( void  )

Definition at line 327 of file cpu.c.

int device_private_init ( struct device dev)

Definition at line 932 of file core.c.

int devices_init ( void  )

Definition at line 1356 of file core.c.

int devres_release_all ( struct device dev)

devres_release_all - Release all managed resources : Device to release resources for

Release all resources associated with . This function is called on driver detach.

Definition at line 506 of file devres.c.

void driver_deferred_probe_del ( struct device dev)

Definition at line 120 of file dd.c.

void driver_detach ( struct device_driver drv)

driver_detach - detach driver from all devices it controls. : driver.

Definition at line 535 of file dd.c.

int driver_probe_device ( struct device_driver drv,
struct device dev 

driver_probe_device - attempt to bind device & driver together : driver to bind a device to : device to try to bind to the driver

This function returns -ENODEV if the device is not registered, 1 if the device is bound successfully and 0 otherwise.

This function must be called with lock held. When called for a USB interface, ->parent lock must be held as well.

Definition at line 362 of file dd.c.

int firmware_init ( void  )

Definition at line 21 of file firmware.c.

char* make_class_name ( const char name,
struct kobject kobj 
int platform_bus_init ( void  )

Definition at line 880 of file platform.c.

Variable Documentation

struct kset* devices_kset

Definition at line 534 of file core.c.