From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CA3CBC433F5 for ; Wed, 24 Nov 2021 22:23:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E60B78365E; Wed, 24 Nov 2021 23:23:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="hlTGgvDf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B8FA082F87; Wed, 24 Nov 2021 23:22:42 +0100 (CET) Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3DFA483681 for ; Wed, 24 Nov 2021 23:22:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ua1-x934.google.com with SMTP id az37so8205576uab.13 for ; Wed, 24 Nov 2021 14:22:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:from:in-reply-to:references:date:message-id :subject:to:cc; bh=Pd98YnVFSXBEQZWZ/srRoQ747VJiLF292CbeZHaq9E4=; b=hlTGgvDfvs2crCkkF8IZg3m9JTlB0UXLfLjxjE1UXUTBZUeU/8iWcF8pbNLCOB5WYU LsuIfKjkj/3mN73sljyk70PDgcg28Eiz2PT3Ih3d3SmBhUI7hT9Xot7FEYucQv6BujoK EzaAmfkQWIwosO7kh/WRAT4aP9QgIWxxDAXDU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:sender:from:in-reply-to:references :date:message-id:subject:to:cc; bh=Pd98YnVFSXBEQZWZ/srRoQ747VJiLF292CbeZHaq9E4=; b=YYiul8+NEg4T37GIh+w4nLGNCfKpQrioXeLq648uP9wlkllmqSYtqMLEd8f/F/Rcdh 52FpGZbHXV7LzYDMobL9QLgKgqxlcxIdjnMgxHtQEHX/pYWLA71805ZX85pA4daOW/vA zHJunOSiwItU77rKTCXg3ynWHw4ih5TTvHrDmdOg/6I1EeUy/zLhqrbBbQgDB3lu9VW/ 6ME6J2JdnEPR323791CcIZB09IDA4IBjr5oWigQpENajvh+cyo8BmlaDSJHboJvIsvQ7 8LIJhDEYqSZvlpKinFjnoa4bFGOxFDylWEfYYDRD00qLp5bywPHGFMNjQl06Stp+2NtE oNzA== X-Gm-Message-State: AOAM532aFbbyniBqGHVFYOYuXLhO68zpVonrUk3sJguBO9RMsk3mPHWw 1givD25qJsuimZAcdF2tunp35X/Yu2eXlo0Lis4dOA== X-Google-Smtp-Source: ABdhPJzAcBx93bW1rfMXfTXWH39N44bXBFtJOjviQEWEL/Ik4dergyJnMA+BEuV2mrZnuP/mv/Y9+T5u7JGeHWTNdw0= X-Received: by 2002:a05:6102:c86:: with SMTP id f6mr1035020vst.38.1637792549516; Wed, 24 Nov 2021 14:22:29 -0800 (PST) Received: from 480794996271 named unknown by gmailapi.google.com with HTTPREST; Wed, 24 Nov 2021 17:22:28 -0500 MIME-Version: 1.0 From: Simon Glass In-Reply-To: <20211023232635.9195-10-sjg@chromium.org> References: <20211023232635.9195-10-sjg@chromium.org> <20211023232635.9195-1-sjg@chromium.org> Date: Wed, 24 Nov 2021 17:22:28 -0500 X-Google-Sender-Auth: XVHZ-BiLMtNFVaiWMlxsreG1b9U Message-ID: Subject: Re: [PATCH v2 11/41] dm: core: Fix handling of uclass pre_unbind method To: Simon Glass Cc: Michal Simek , Heinrich Schuchardt , Tom Rini , Ilias Apalodimas , Daniel Schwierzeck , Steffen Jaeckel , =?UTF-8?B?TWFyZWsgQmVow7pu?= , Lukas Auer , Dennis Gilmore , Marek Vasut , Pavel Herrmann , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean This method is currently called after the platform data has been freed. But the pre_unbind() method may wish to access this, e.g. to free some data structures stored there. Split the unbinding of devices into two pieces, as is done with removal. This corrects the problem. Also tidy a code-style issue in device_remove() while we are here. Signed-off-by: Simon Glass --- (no changes since v1) drivers/core/device-remove.c | 9 +++++---- drivers/core/uclass.c | 8 +++++++- include/dm/uclass-internal.h | 14 +++++++++++++- 3 files changed, 25 insertions(+), 6 deletions(-) Applied to u-boot-dm/next, thanks!