mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
dm: Allow device removal features to be dropped
For SPL we don't expect to need to remove a device. Save some code space by dropping this feature. The board config can define CONFIG_DM_DEVICE_REMOVE if this is in fact needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
This commit is contained in:
parent
1151651831
commit
3ac435d33a
5 changed files with 203 additions and 169 deletions
|
@ -87,7 +87,11 @@ int device_probe_child(struct udevice *dev, void *parent_priv);
|
|||
* @dev: Pointer to device to remove
|
||||
* @return 0 if OK, -ve on error (an error here is normally a very bad thing)
|
||||
*/
|
||||
#ifdef CONFIG_DM_DEVICE_REMOVE
|
||||
int device_remove(struct udevice *dev);
|
||||
#else
|
||||
static inline int device_remove(struct udevice *dev) { return 0; }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* device_unbind() - Unbind a device, destroying it
|
||||
|
@ -99,6 +103,12 @@ int device_remove(struct udevice *dev);
|
|||
*/
|
||||
int device_unbind(struct udevice *dev);
|
||||
|
||||
#ifdef CONFIG_DM_DEVICE_REMOVE
|
||||
void device_free(struct udevice *dev);
|
||||
#else
|
||||
static inline void device_free(struct udevice *dev) {}
|
||||
#endif
|
||||
|
||||
/* Cast away any volatile pointer */
|
||||
#define DM_ROOT_NON_CONST (((gd_t *)gd)->dm_root)
|
||||
#define DM_UCLASS_ROOT_NON_CONST (((gd_t *)gd)->uclass_root)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue