From patchwork Wed Jan 10 10:55:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 858222 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="B6B03w6s"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zGmFF1RN5z9ryv for ; Wed, 10 Jan 2018 21:57:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964951AbeAJK5j (ORCPT ); Wed, 10 Jan 2018 05:57:39 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:65194 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755310AbeAJKzD (ORCPT ); Wed, 10 Jan 2018 05:55:03 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w0AAspD0006825; Wed, 10 Jan 2018 04:54:51 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1515581691; bh=f+CtcFoVxE2O0Iwl4z3A3vvdY4UPYG+47McQFqbASg0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=B6B03w6sPl/zPLdXawWFcwODJ6nGVm4jCiyKCIP/mDf93ZrNlPOLcoO+y3bbnjlxh VG7r9vR1WUfCh4M1t1QC72tzKLwwZpzBXudnQ9T2v6dmfqDaheVMEoV7guESfLJPgC AtIAoWqTRIm+/hfxCxz58gIJ/u+aMO/GLFMnYqrA= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0AAspEL015058; Wed, 10 Jan 2018 04:54:51 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 10 Jan 2018 04:54:50 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 10 Jan 2018 04:54:50 -0600 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0AAsVfM026375; Wed, 10 Jan 2018 04:54:46 -0600 From: Faiz Abbas To: , , , CC: , , , , , , , , , , , Subject: [PATCH v7 3/8] can: m_can: Remove check for version when allocating m_can net device Date: Wed, 10 Jan 2018 16:25:20 +0530 Message-ID: <1515581725-29242-4-git-send-email-faiz_abbas@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515581725-29242-1-git-send-email-faiz_abbas@ti.com> References: <1515581725-29242-1-git-send-email-faiz_abbas@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently the m_can version is used to set the tx_fifo_count to 1 when allocating the net device. However, this is redundant as a value of 1 for the tx_fifo_count needs to be provided in the bosch,mram-cfg property of the device tree node anyway. Therefore, remove check for version when allocating the net device. Signed-off-by: Faiz Abbas --- drivers/net/can/m_can/m_can.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index f72116e..893edbb 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1213,7 +1213,6 @@ static struct net_device *alloc_m_can_dev(struct platform_device *pdev, struct net_device *dev; struct m_can_priv *priv; int m_can_version; - unsigned int echo_buffer_count; m_can_version = m_can_check_core_release(addr); /* return if unsupported version */ @@ -1222,12 +1221,7 @@ static struct net_device *alloc_m_can_dev(struct platform_device *pdev, goto return_dev; } - /* If version < 3.1.x, then only one echo buffer is used */ - echo_buffer_count = ((m_can_version == 30) - ? 1U - : (unsigned int)tx_fifo_size); - - dev = alloc_candev(sizeof(*priv), echo_buffer_count); + dev = alloc_candev(sizeof(*priv), tx_fifo_size); if (!dev) { dev = NULL; goto return_dev;