linux-2.6.33/device_del()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#kc9009ac]
#backlinks
*説明 [#e16ccd38]
-パス: [[linux-2.6.33/drivers/base/core.c]]
-FIXME: これは何?
--説明
**引数 [#i31bed17]
-struct device *dev
--
--[[linux-2.6.33/device]]
**返り値 [#u6e2b7a1]
-なし
**参考 [#z56f2417]
*実装 [#m006a9cc]
void device_del(struct device *dev)
{
struct device *parent = dev->parent;
struct class_interface *class_intf;
-
--[[linux-2.6.33/class_interface]]
/* Notify clients of device removal. This call must come
* before dpm_sysfs_remove().
*/
if (dev->bus)
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
BUS_NOTIFY_DEL_DEVICE, dev);
device_pm_remove(dev);
dpm_sysfs_remove(dev);
-
--[[linux-2.6.33/blocking_notifier_call_chain()]]
-
--[[linux-2.6.33/BUS_NOTIFY_DEL_DEVICE]]
-
--[[linux-2.6.33/device_pm_remove()]]
-
--[[linux-2.6.33/dpm_sysfs_remove()]]
if (parent)
klist_del(&dev->p->knode_parent);
-
--[[linux-2.6.33/klist_del()]]
if (MAJOR(dev->devt)) {
devtmpfs_delete_node(dev);
device_remove_sys_dev_entry(dev);
device_remove_file(dev, &devt_attr);
}
-
--[[linux-2.6.33/MAJOR()]]
-
--[[linux-2.6.33/devtmpfs_delete_node()]]
-
--[[linux-2.6.33/device_remove_sys_dev_entry()]]
-
--[[linux-2.6.33/device_remove_file()]]
-
--[[linux-2.6.33/devt_attr(global)]]
if (dev->class) {
device_remove_class_symlinks(dev);
-
--[[linux-2.6.33/device_remove_class_symlinks()]]
mutex_lock(&dev->class->p->class_mutex);
-
--[[linux-2.6.33/mutex_lock()]]
/* notify any interfaces that the device is now gone */
list_for_each_entry(class_intf,
&dev->class->p->class_interfaces, node)
if (class_intf->remove_dev)
class_intf->remove_dev(dev, class_intf);
-
--[[linux-2.6.33/list_for_each_entry()]]
-
--[[linux-2.6.33/class_intf(global)]]
-
--[[linux-2.6.33/node(global)]]
/* remove the device from the class list */
klist_del(&dev->knode_class);
mutex_unlock(&dev->class->p->class_mutex);
-
--[[linux-2.6.33/klist_del()]]
-
--[[linux-2.6.33/mutex_unlock()]]
}
device_remove_file(dev, &uevent_attr);
device_remove_attrs(dev);
bus_remove_device(dev);
-
--[[linux-2.6.33/device_remove_file()]]
-
--[[linux-2.6.33/uevent_attr(global)]]
-
--[[linux-2.6.33/device_remove_attrs()]]
-
--[[linux-2.6.33/bus_remove_device()]]
/*
* Some platform devices are driven without driver atta...
* and managed resources may have been acquired. Make ...
* all resources are released.
*/
devres_release_all(dev);
-
--[[linux-2.6.33/devres_release_all()]]
/* Notify the platform of the removal, in case they
* need to do anything...
*/
if (platform_notify_remove)
platform_notify_remove(dev);
-
--[[linux-2.6.33/platform_notify_remove(global)]]
kobject_uevent(&dev->kobj, KOBJ_REMOVE);
cleanup_device_parent(dev);
kobject_del(&dev->kobj);
put_device(parent);
-
--[[linux-2.6.33/kobject_uevent()]]
-
--[[linux-2.6.33/KOBJ_REMOVE]]
-
--[[linux-2.6.33/cleanup_device_parent()]]
-
--[[linux-2.6.33/kobject_del()]]
-
--[[linux-2.6.33/put_device()]]
}
*コメント [#w4c8da26]
終了行:
*参照元 [#kc9009ac]
#backlinks
*説明 [#e16ccd38]
-パス: [[linux-2.6.33/drivers/base/core.c]]
-FIXME: これは何?
--説明
**引数 [#i31bed17]
-struct device *dev
--
--[[linux-2.6.33/device]]
**返り値 [#u6e2b7a1]
-なし
**参考 [#z56f2417]
*実装 [#m006a9cc]
void device_del(struct device *dev)
{
struct device *parent = dev->parent;
struct class_interface *class_intf;
-
--[[linux-2.6.33/class_interface]]
/* Notify clients of device removal. This call must come
* before dpm_sysfs_remove().
*/
if (dev->bus)
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
BUS_NOTIFY_DEL_DEVICE, dev);
device_pm_remove(dev);
dpm_sysfs_remove(dev);
-
--[[linux-2.6.33/blocking_notifier_call_chain()]]
-
--[[linux-2.6.33/BUS_NOTIFY_DEL_DEVICE]]
-
--[[linux-2.6.33/device_pm_remove()]]
-
--[[linux-2.6.33/dpm_sysfs_remove()]]
if (parent)
klist_del(&dev->p->knode_parent);
-
--[[linux-2.6.33/klist_del()]]
if (MAJOR(dev->devt)) {
devtmpfs_delete_node(dev);
device_remove_sys_dev_entry(dev);
device_remove_file(dev, &devt_attr);
}
-
--[[linux-2.6.33/MAJOR()]]
-
--[[linux-2.6.33/devtmpfs_delete_node()]]
-
--[[linux-2.6.33/device_remove_sys_dev_entry()]]
-
--[[linux-2.6.33/device_remove_file()]]
-
--[[linux-2.6.33/devt_attr(global)]]
if (dev->class) {
device_remove_class_symlinks(dev);
-
--[[linux-2.6.33/device_remove_class_symlinks()]]
mutex_lock(&dev->class->p->class_mutex);
-
--[[linux-2.6.33/mutex_lock()]]
/* notify any interfaces that the device is now gone */
list_for_each_entry(class_intf,
&dev->class->p->class_interfaces, node)
if (class_intf->remove_dev)
class_intf->remove_dev(dev, class_intf);
-
--[[linux-2.6.33/list_for_each_entry()]]
-
--[[linux-2.6.33/class_intf(global)]]
-
--[[linux-2.6.33/node(global)]]
/* remove the device from the class list */
klist_del(&dev->knode_class);
mutex_unlock(&dev->class->p->class_mutex);
-
--[[linux-2.6.33/klist_del()]]
-
--[[linux-2.6.33/mutex_unlock()]]
}
device_remove_file(dev, &uevent_attr);
device_remove_attrs(dev);
bus_remove_device(dev);
-
--[[linux-2.6.33/device_remove_file()]]
-
--[[linux-2.6.33/uevent_attr(global)]]
-
--[[linux-2.6.33/device_remove_attrs()]]
-
--[[linux-2.6.33/bus_remove_device()]]
/*
* Some platform devices are driven without driver atta...
* and managed resources may have been acquired. Make ...
* all resources are released.
*/
devres_release_all(dev);
-
--[[linux-2.6.33/devres_release_all()]]
/* Notify the platform of the removal, in case they
* need to do anything...
*/
if (platform_notify_remove)
platform_notify_remove(dev);
-
--[[linux-2.6.33/platform_notify_remove(global)]]
kobject_uevent(&dev->kobj, KOBJ_REMOVE);
cleanup_device_parent(dev);
kobject_del(&dev->kobj);
put_device(parent);
-
--[[linux-2.6.33/kobject_uevent()]]
-
--[[linux-2.6.33/KOBJ_REMOVE]]
-
--[[linux-2.6.33/cleanup_device_parent()]]
-
--[[linux-2.6.33/kobject_del()]]
-
--[[linux-2.6.33/put_device()]]
}
*コメント [#w4c8da26]
ページ名: