mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
dm: core: Remove unnecessary codes in uclass_pre_remove_device()
dev->uclass->uc_drv->per_device_auto_alloc_size is to be freed in device_free(), so is dev->seq. Remove these unnecessary codes. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
3f616b6053
commit
50dae85c71
1 changed files with 0 additions and 7 deletions
|
@ -523,22 +523,15 @@ int uclass_post_probe_device(struct udevice *dev)
|
||||||
#if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE)
|
#if CONFIG_IS_ENABLED(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 *uc;
|
struct uclass *uc;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
uc = dev->uclass;
|
uc = dev->uclass;
|
||||||
uc_drv = uc->uc_drv;
|
|
||||||
if (uc->uc_drv->pre_remove) {
|
if (uc->uc_drv->pre_remove) {
|
||||||
ret = uc->uc_drv->pre_remove(dev);
|
ret = uc->uc_drv->pre_remove(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
if (uc_drv->per_device_auto_alloc_size) {
|
|
||||||
free(dev->uclass_priv);
|
|
||||||
dev->uclass_priv = NULL;
|
|
||||||
}
|
|
||||||
dev->seq = -1;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue