]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: core: Remove unnecessary codes in uclass_pre_remove_device()
authorBin Meng <bmeng.cn@gmail.com>
Thu, 8 Oct 2015 04:32:40 +0000 (21:32 -0700)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 29 Oct 2015 19:05:51 +0000 (14:05 -0500)
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>
drivers/core/uclass.c

index e800c28653f6170c62d9e1aeb23da1ced4ebea7a..1af09472a2cb76cc82b704bb626054ad5093c1da 100644 (file)
@@ -523,22 +523,15 @@ int uclass_post_probe_device(struct udevice *dev)
 #if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE)
 int uclass_pre_remove_device(struct udevice *dev)
 {
-       struct uclass_driver *uc_drv;
        struct uclass *uc;
        int ret;
 
        uc = dev->uclass;
-       uc_drv = uc->uc_drv;
        if (uc->uc_drv->pre_remove) {
                ret = uc->uc_drv->pre_remove(dev);
                if (ret)
                        return ret;
        }
-       if (uc_drv->per_device_auto_alloc_size) {
-               free(dev->uclass_priv);
-               dev->uclass_priv = NULL;
-       }
-       dev->seq = -1;
 
        return 0;
 }