Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1238986pxu; Mon, 23 Nov 2020 15:37:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9E2fLKav1IcWbinYdqnuWNtobakI5pYHnFN3hN41vM6W2A4Ac5RfNBN7LMRWeR2qI2mPY X-Received: by 2002:aa7:c61a:: with SMTP id h26mr1507650edq.327.1606174675510; Mon, 23 Nov 2020 15:37:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174675; cv=none; d=google.com; s=arc-20160816; b=kTvD/kzrtkuOwM2slTyTQK9kaY8U/sXqv2uIdGHM8sq4fCjvwV8Hr6+70neW1eFfHW 6fkZ3O6PYhTlw5WsYgjZHrfxqGOodriOBVKRxy6jg7ulOC193x8kxc3RKxfaIM7lYpwy TDOd9JGpa86d8XSTievmAQ0CG3dixJvXplSxYMeWmzOiMeCS7RaQ2GtxCGqbZWEiEbUU iH1zyJsWGmzIoXKFzlAhfYnw3tzZVrRoq9qZpTJASosngXCCll+pINW7xuWGFUe9WK8n rVrV3FozedSmXbnclIYRRdfGML4VELJ5Qb0fphoWigWYNU8PbVxWej621WUCC4o66cVc yLmA== 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=t5xKxwvbhYi2o+0UHZtrQ8xQP+F/uULGLlfwM+1anqc=; b=bC9OMWwJV5gn5QNsVoi+wxz0NQwb2qpQtY+WfOtEzERuBeqfaG7u/L3FvSYA6e0neI MJ7S4IBIgaHGUUHUjnbOG2cinDZpsKZ7RhJWgltatZ056zMY+/uuVSbNnLs3HiDpCqOK zvPCM5mo1tLe2qlhkfLAWXZuYLDyyeGJcFu+E9UBV6Sj5T7CeirxJgw1hwvQiH9rnllE 3cVSQTDCNSJGgq5qaYvMBmr4vvoeZU8wgB5lvfxjiSuFnvOeaMsnn/K01KdaeOSD27kF i/LDurlesXiUL9j5CmWSH7vruGedEHjmLNg6ovClfBdohzrRWBupsF0TrXtYGJElju36 AHbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=krKHszm1; 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 q4si8798974eji.62.2020.11.23.15.37.33; Mon, 23 Nov 2020 15:37:55 -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=krKHszm1; 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 S1731955AbgKWMhf (ORCPT + 99 others); Mon, 23 Nov 2020 07:37:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731950AbgKWMhd (ORCPT ); Mon, 23 Nov 2020 07:37:33 -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 6292720721; Mon, 23 Nov 2020 12:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135052; bh=fad5RsFsDcYmx3WnNjUYtph/NtbsRCcpG5eDcMmES1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=krKHszm1YuQZy+c6hQ23X3E5+K3rOcneJTyhd7CQj7YWgZb7Vb/7itoDzFlhmcfGA n8tFs81A5smizW9HlbdizzvTTMz3acG9hlfHTkDFDiFwGyJv/lI7L0jfg7HWatuXdx S11sgCx4okIe/zXqLcYSDL3NsRTJ4ziUPscovHvc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Kleine-Budde , Dan Murphy , Sasha Levin Subject: [PATCH 5.4 086/158] can: m_can: m_can_class_free_dev(): introduce new function Date: Mon, 23 Nov 2020 13:21:54 +0100 Message-Id: <20201123121824.084377619@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: Dan Murphy [ Upstream commit a8c22f5b0c689a29f45ef4a110d09fd391debcbc ] This patch creates a common function that peripherials can call to free the netdev device when failures occur. Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework") Reported-by: Marc Kleine-Budde Signed-off-by: Dan Murphy Link: http://lore.kernel.org/r/20200227183829.21854-2-dmurphy@ti.com Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/m_can/m_can.c | 6 ++++++ drivers/net/can/m_can/m_can.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 20f025b4f6d4c..85e3df24e7bfb 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1764,6 +1764,12 @@ out: } EXPORT_SYMBOL_GPL(m_can_class_allocate_dev); +void m_can_class_free_dev(struct net_device *net) +{ + free_candev(net); +} +EXPORT_SYMBOL_GPL(m_can_class_free_dev); + int m_can_class_register(struct m_can_classdev *m_can_dev) { int ret; diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h index 49f42b50627a1..b2699a7c99973 100644 --- a/drivers/net/can/m_can/m_can.h +++ b/drivers/net/can/m_can/m_can.h @@ -99,6 +99,7 @@ struct m_can_classdev { }; struct m_can_classdev *m_can_class_allocate_dev(struct device *dev); +void m_can_class_free_dev(struct net_device *net); int m_can_class_register(struct m_can_classdev *cdev); void m_can_class_unregister(struct m_can_classdev *cdev); int m_can_class_get_clocks(struct m_can_classdev *cdev); -- 2.27.0