Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dd.c File Reference
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/wait.h>
#include <linux/async.h>
#include <linux/pm_runtime.h>
#include "base.h"
#include "power/power.h"

Go to the source code of this file.


void driver_deferred_probe_del (struct device *dev)
 late_initcall (deferred_probe_initcall)
int device_bind_driver (struct device *dev)
 EXPORT_SYMBOL_GPL (device_bind_driver)
int driver_probe_done (void)
void wait_for_device_probe (void)
 EXPORT_SYMBOL_GPL (wait_for_device_probe)
int driver_probe_device (struct device_driver *drv, struct device *dev)
int device_attach (struct device *dev)
 EXPORT_SYMBOL_GPL (device_attach)
int driver_attach (struct device_driver *drv)
 EXPORT_SYMBOL_GPL (driver_attach)
void device_release_driver (struct device *dev)
 EXPORT_SYMBOL_GPL (device_release_driver)
void driver_detach (struct device_driver *drv)
voiddev_get_drvdata (const struct device *dev)
 EXPORT_SYMBOL (dev_get_drvdata)
int dev_set_drvdata (struct device *dev, void *data)
 EXPORT_SYMBOL (dev_set_drvdata)

Function Documentation

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 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 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.

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.

int 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.

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 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.

EXPORT_SYMBOL ( dev_get_drvdata  )
EXPORT_SYMBOL ( dev_set_drvdata  )
EXPORT_SYMBOL_GPL ( device_bind_driver  )
EXPORT_SYMBOL_GPL ( wait_for_device_probe  )
EXPORT_SYMBOL_GPL ( device_attach  )
EXPORT_SYMBOL_GPL ( driver_attach  )
EXPORT_SYMBOL_GPL ( device_release_driver  )
late_initcall ( deferred_probe_initcall  )
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.