Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1306638pxu; Mon, 23 Nov 2020 17:51:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbDerM31EkEBDNTH+qxD6YpeNnPStrFWBtsqK9LiVbRGLagtq1piKNs9Rb5rJ1bZNt2aZT X-Received: by 2002:a17:906:13d2:: with SMTP id g18mr2241400ejc.76.1606182719373; Mon, 23 Nov 2020 17:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606182719; cv=none; d=google.com; s=arc-20160816; b=y03A60WJYvhhy/IK53ccXI+qVNe4ZT98lpAaHTWk8vTHuVlcW8a1dcgpoHch/5FSzw x95CbdFeAdymGnSjttOxrUw8vveC/E/YHs2yiWLeJ95A821xbs0iB5e0TRsZ8lIIRmzo qcdtVVPgLVQxrOldj3NCsXkRXB+NxQth3e8OF8cTtDzrzgZs4rHPlTNMYZHRVY8APEzr WysV1ZlPhELKV6EhsSTe6aliE4eF1XrDrF5OyPJydutFaE4CtLvWUYlSB+vkhlLTeZEJ UgX2qIYo9ZAc3pLN2uMM+uIVyyRy2XDKbb4tTNtPjX+8MGU137vtXoGjMQN4+AD9tIb4 0szw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nLLhKBVqfRKKmtmlu10nvwNA6ek7lFEFN4XZP2W58tU=; b=y7RgUy2Ij/M7EG6dyOL9crnZJlUO7kwEss+On85+r0DMtaWEFwgCLmEjn6EATS8/+A xaJP0gofZ0POCgw79gQumQjKGuJXbObhSgD4gvF+1tzW4Jm876VSEJ5P2vvjuyLgdlHd rOGlNg997B6Kedo7IpZPyHg+fExf5kpPgo9q0RKBIwnDRSw9nbb99ZY1u7S6w60VCSXq mgmrnuO2T/crGvkvkQZ3xvNW2CqY9CYeE3k4otw3uyPRDeqJDx8UEQFSillGw2qaQujg C6gRSY80VdcBkiri9UGWP34nSc1eKUpyiXiI7g5/g7nvWD6z2jimfbuIR56xFgZiCzm+ 1KLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KnCWxDFI; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si7413711eju.619.2020.11.23.17.51.23; Mon, 23 Nov 2020 17:51:59 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=KnCWxDFI; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731945AbgKWMhb (ORCPT + 99 others); Mon, 23 Nov 2020 07:37:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:49692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731933AbgKWMh1 (ORCPT ); Mon, 23 Nov 2020 07:37:27 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CE25520721; Mon, 23 Nov 2020 12:37:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135047; bh=lZvBpeRjlI/VW97KSB7IlHBYVy1l46kdMCQZECCsG1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KnCWxDFI/rYwj1N3CmS4PMgx3nriXPikDROS0YolJLwqkFV+GeuB1mUd9NH3kWjtJ 8mcGKOVycdsfiX5m21JxbZsBmeIuuGoXq7pAwc0QQjRaF3cajvtD81IQCIuD10tIMU dWHK6rrKX5rPzNeLt3GM0dr6nt5m6Qo61OpPOcjI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Murphy , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.4 084/158] can: tcan4x5x: tcan4x5x_can_remove(): fix order of deregistration Date: Mon, 23 Nov 2020 13:21:52 +0100 Message-Id: <20201123121823.987303756@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Kleine-Budde [ Upstream commit c81d0b6ca665477c761f227807010762630b089f ] Change the order in tcan4x5x_can_remove() to be the exact inverse of tcan4x5x_can_probe(). First m_can_class_unregister(), then power down the device. Fixes: 5443c226ba91 ("can: tcan4x5x: Add tcan4x5x driver to the kernel") Cc: Dan Murphy Link: http://lore.kernel.org/r/20201019154233.1262589-10-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/m_can/tcan4x5x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c index 11c223a534887..681bb861de05e 100644 --- a/drivers/net/can/m_can/tcan4x5x.c +++ b/drivers/net/can/m_can/tcan4x5x.c @@ -501,10 +501,10 @@ static int tcan4x5x_can_remove(struct spi_device *spi) { struct tcan4x5x_priv *priv = spi_get_drvdata(spi); - tcan4x5x_power_enable(priv->power, 0); - m_can_class_unregister(priv->mcan_dev); + tcan4x5x_power_enable(priv->power, 0); + return 0; } -- 2.27.0