From patchwork Thu Oct 8 04:32:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 527588 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 620911402A8 for ; Thu, 8 Oct 2015 15:30:27 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=fktiOY1f; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B2CD4B8B0; Thu, 8 Oct 2015 06:30:24 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ULtM6wENvXsu; Thu, 8 Oct 2015 06:30:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 304C34B8BF; Thu, 8 Oct 2015 06:30:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 874EB4B89A for ; Thu, 8 Oct 2015 06:30:13 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TDNEqKRoSJ_h for ; Thu, 8 Oct 2015 06:30:13 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by theia.denx.de (Postfix) with ESMTPS id 1B1A84B899 for ; Thu, 8 Oct 2015 06:30:11 +0200 (CEST) Received: by pablk4 with SMTP id lk4so41921077pab.3 for ; Wed, 07 Oct 2015 21:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=E85JL6Ft/0ZlNG6TcYqQSdKRJfRgswpGorLdcdwiXww=; b=fktiOY1fXTTDnaPp4ZV2f2SCUmICgkODSabxHbNuF8SL+EROAg73qJQmzFUQ8aNuBv sDlC3AV323A1sN3g5EX9cG3SsBX6wXgUEpbvjY0e3+Q03YeQSzQCrv0hTcLHWlg/+NSX P6FQ08Rsy0N9vMfEITQVcNcQrr/z1gloGN+D4kdTdvMACiSH/cEo3nXNVPl73sasoVva lbG0sf+CiYnBPv8bKIAd7EWMQaAGRMPXoilfoVz5Yhm9NKkdjWZbxyVGgp1rCX1r6SXl zcBFEsxuC3LccPhBVQmJuXXLHsbiLIluJIx9VWT8c9kjd+GpUdIv/VbubnZcbsc8p6TU N4aQ== X-Received: by 10.66.165.5 with SMTP id yu5mr5495215pab.109.1444278609909; Wed, 07 Oct 2015 21:30:09 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-157-139.windriver.com. [147.11.157.139]) by smtp.gmail.com with ESMTPSA id z4sm20743581par.6.2015.10.07.21.30.09 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Oct 2015 21:30:09 -0700 (PDT) From: Bin Meng To: Joe Hershberger , Simon Glass , U-Boot Mailing List Date: Wed, 7 Oct 2015 21:32:40 -0700 Message-Id: <1444278760-31530-4-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1444278760-31530-1-git-send-email-bmeng.cn@gmail.com> References: <1444278760-31530-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH v2 4/4] dm: core: Remove unnecessary codes in uclass_pre_remove_device() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Acked-by: Simon Glass --- Changes in v2: - Drop the v1 patch: "dm: core: Remove the call to device_free()" drivers/core/uclass.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index e800c28..1af0947 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -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; }