Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4044497pxf; Mon, 29 Mar 2021 19:55:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYRKiGxRQliYwRczZxW5DIf/TCZTO+jAxtonHvH1lK4hdziy99yhoCXB2jAd2nrVJkopzR X-Received: by 2002:a17:906:9bdb:: with SMTP id de27mr31695109ejc.459.1617072935930; Mon, 29 Mar 2021 19:55:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617072935; cv=none; d=google.com; s=arc-20160816; b=ppxInAaY8gd69htMIUaloTlrpp/QjogEdgK4YyLCoaMicPELqVBOnB5r5cH3rdFW8A Fwlu474kYOh0cav7+HJBx4394KII/tKKaoBGSwnCnQw8EMa0yxLf6xmukYw+T5/Wg1/v AttsFTjJyBU4nze0IqNowijVdhASzAXpBslTge5srHGAmJ3SCIhmcCrPQzy3FSuyx2kb TBPovPmXcUW9SGVSfGDF5X6JUhSwguVrgUL0geteR73V/e34B0pLwX/gCllKhxoAk88D Y1SNRRD8ORRV5JOw3EKP8XN7YL51LmDH3x4dIvspvh8btaqvPaLuxjsGR55chewkJuAj xOKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OPXUOmfQRekvQeQvsP70z1DtiDzMfmRzBeh0Ag8UFxM=; b=CQThPpuFfKmRjWreIXlegPq9JaB52BtsvrHEyCg1WBlGPv6AyUSqAnDpFXG1MD6ejK LccLyDFOUo2J8mtABAKZK76bJzhxYSLWYUrDGVnYL5Xj1smvRHTBTZBpbgB46Ueq5kAB jHRYHnLf+3/v33shmPHbEQs4JpUnHQUqLBlpmj/7jzIK4lciXUas2L/PZ2mKeI2YGrwJ 5XYqOzNxsHusQ3wiym8Fne8d/F87dEBEwp2HnPhpnfxmiDMAFbHQdn8gWuCAaHN3fOYr j4FHmL4yiaJRti51/RyLJQUEo5IO1VqHFaDsLo4+hILegCDMkKBrvXBq3aVFJojZpiGG 0s+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OaZPcHG+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co21si14319485edb.513.2021.03.29.19.55.14; Mon, 29 Mar 2021 19:55:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OaZPcHG+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231332AbhC3CyX (ORCPT + 99 others); Mon, 29 Mar 2021 22:54:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231139AbhC3CyI (ORCPT ); Mon, 29 Mar 2021 22:54:08 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1061BC061764 for ; Mon, 29 Mar 2021 19:54:08 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id w10so6349117pgh.5 for ; Mon, 29 Mar 2021 19:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OPXUOmfQRekvQeQvsP70z1DtiDzMfmRzBeh0Ag8UFxM=; b=OaZPcHG+xa8TmTWZTA0Hwp0y/rk+j9Ba1UMowY1egymnOB4p+aNxLcC2BSvqDs9q5q 4alN2gzkfnk3Pm8vKeca7tvK6mDFvMGmm43+hA3Wj3N4MWwTz4FQMcOux+jyfjfXcW7v cVWAmDIe8H4TDNqiSVKQWU3ft/UkzrUp2AksE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OPXUOmfQRekvQeQvsP70z1DtiDzMfmRzBeh0Ag8UFxM=; b=QzM0iGgZEBruNaMmNxwdd1GgME4W4/74mKW2BEY71D1//eVfvCi/ANOI4D3+MX3rpX APxMzjpBlOCdRT21uFCC7NBmmdJ3ky2CABC+F9+3Wp+RZZVy+jmmXRoKTcKYxJNzrPVX +kidHuCT9PFGOBR5UG21dbLdl6ccoJlR6t2cZe+uax9cAd1UYkKszg7FpQ1gdUbLBz8/ DUzbQq1cg4jbAwylqQeJSE5F+ZL02+0BMl1VvDrqLZIL4U4NgXiWiyHRsOIqm+A6H/74 gMxaxfWSEwewabnqVYJEIMaF4/uhz2CknejD6KlAoszRY2FIYAqReoaJEx16Qisg2FnL ht3Q== X-Gm-Message-State: AOAM530loWzTLbqSwoS17vIK4zI0eJw92gp6+96dN53SSOf4kqBJVUHM otUNEnq6Bf6TnHPbnYFxkJ8cKw== X-Received: by 2002:a63:2265:: with SMTP id t37mr14590832pgm.452.1617072847654; Mon, 29 Mar 2021 19:54:07 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:f599:1ca7:742d:6b50]) by smtp.gmail.com with ESMTPSA id t17sm19152706pgk.25.2021.03.29.19.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 19:54:07 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg Cc: Bjorn Andersson , Stephen Boyd , Maarten Lankhorst , robdclark@chromium.org, Stanislav Lisovskiy , linux-arm-msm@vger.kernel.org, Steev Klimaszewski , Linus W , Douglas Anderson , Daniel Vetter , David Airlie , Robert Foss , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 04/14] drm/bridge: ti-sn65dsi86: Reorder remove() Date: Mon, 29 Mar 2021 19:53:35 -0700 Message-Id: <20210329195255.v2.4.Ifcf1deaa372eba7eeb4f8eb516c5d15b77a657a9@changeid> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210330025345.3980086-1-dianders@chromium.org> References: <20210330025345.3980086-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's make the remove() function strictly the reverse of the probe() function so it's easier to reason about. NOTES: - The MIPI calls probably belong in detach() but will be moved in a separate patch. - The cached EDID freeing isn't actually part of probe but needs to be in remove to avoid orphaning memory until better handling of the EDID happens. This patch was created by code inspection and should move us closer to a proper remove. Signed-off-by: Douglas Anderson --- (no changes since v1) drivers/gpu/drm/bridge/ti-sn65dsi86.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 76f43af6735d..c006678c9921 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -1315,20 +1315,21 @@ static int ti_sn_bridge_remove(struct i2c_client *client) if (!pdata) return -EINVAL; - kfree(pdata->edid); - ti_sn_debugfs_remove(pdata); - - of_node_put(pdata->host_node); - - pm_runtime_disable(pdata->dev); - if (pdata->dsi) { mipi_dsi_detach(pdata->dsi); mipi_dsi_device_unregister(pdata->dsi); } + kfree(pdata->edid); + + ti_sn_debugfs_remove(pdata); + drm_bridge_remove(&pdata->bridge); + pm_runtime_disable(pdata->dev); + + of_node_put(pdata->host_node); + return 0; } -- 2.31.0.291.g576ba9dcdaf-goog