Skip to content
Snippets Groups Projects
Commit 7f9875e7 authored by Simon Glass's avatar Simon Glass
Browse files

dm: core: Remove unbind operations when not required


The CONFIG_DM_DEVICE_REMOVE option takes out code related to removing
devices. It should also remove the 'unbind' code since if we cannot
remove we probably don't need to unbind.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 36fa61dc
No related branches found
No related tags found
No related merge requests found
...@@ -386,6 +386,7 @@ err: ...@@ -386,6 +386,7 @@ err:
return ret; return ret;
} }
#ifdef CONFIG_DM_DEVICE_REMOVE
int uclass_unbind_device(struct udevice *dev) int uclass_unbind_device(struct udevice *dev)
{ {
struct uclass *uc; struct uclass *uc;
...@@ -401,6 +402,7 @@ int uclass_unbind_device(struct udevice *dev) ...@@ -401,6 +402,7 @@ int uclass_unbind_device(struct udevice *dev)
list_del(&dev->uclass_node); list_del(&dev->uclass_node);
return 0; return 0;
} }
#endif
int uclass_resolve_seq(struct udevice *dev) int uclass_resolve_seq(struct udevice *dev)
{ {
...@@ -464,6 +466,7 @@ int uclass_post_probe_device(struct udevice *dev) ...@@ -464,6 +466,7 @@ int uclass_post_probe_device(struct udevice *dev)
return 0; return 0;
} }
#ifdef CONFIG_DM_DEVICE_REMOVE
int uclass_pre_remove_device(struct udevice *dev) int uclass_pre_remove_device(struct udevice *dev)
{ {
struct uclass_driver *uc_drv; struct uclass_driver *uc_drv;
...@@ -485,3 +488,4 @@ int uclass_pre_remove_device(struct udevice *dev) ...@@ -485,3 +488,4 @@ int uclass_pre_remove_device(struct udevice *dev)
return 0; return 0;
} }
#endif
...@@ -116,7 +116,11 @@ int uclass_bind_device(struct udevice *dev); ...@@ -116,7 +116,11 @@ int uclass_bind_device(struct udevice *dev);
* @dev: Pointer to the device * @dev: Pointer to the device
* #return 0 on success, -ve on error * #return 0 on success, -ve on error
*/ */
#ifdef CONFIG_DM_DEVICE_REMOVE
int uclass_unbind_device(struct udevice *dev); int uclass_unbind_device(struct udevice *dev);
#else
static inline int uclass_unbind_device(struct udevice *dev) { return 0; }
#endif
/** /**
* uclass_pre_probe_device() - Deal with a device that is about to be probed * uclass_pre_probe_device() - Deal with a device that is about to be probed
...@@ -149,7 +153,11 @@ int uclass_post_probe_device(struct udevice *dev); ...@@ -149,7 +153,11 @@ int uclass_post_probe_device(struct udevice *dev);
* @dev: Pointer to the device * @dev: Pointer to the device
* #return 0 on success, -ve on error * #return 0 on success, -ve on error
*/ */
#ifdef CONFIG_DM_DEVICE_REMOVE
int uclass_pre_remove_device(struct udevice *dev); int uclass_pre_remove_device(struct udevice *dev);
#else
static inline int uclass_pre_remove_device(struct udevice *dev) { return 0; }
#endif
/** /**
* uclass_find() - Find uclass by its id * uclass_find() - Find uclass by its id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment