Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751487AbcLDPSQ (ORCPT ); Sun, 4 Dec 2016 10:18:16 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36208 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751260AbcLDPSN (ORCPT ); Sun, 4 Dec 2016 10:18:13 -0500 From: Nikita Yushchenko To: "David S. Miller" , Fugang Duan , Troy Kisky , Andrew Lunn , Eric Nelson , Philippe Reynes , Johannes Berg , netdev@vger.kernel.org Cc: Chris Healy , Fabio Estevam , linux-kernel@vger.kernel.org, Nikita Yushchenko Subject: [patch net] net: fec: fix compile with CONFIG_M5272 Date: Sun, 4 Dec 2016 18:17:57 +0300 Message-Id: <1480864677-15310-1-git-send-email-nikita.yoush@cogentembedded.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1796 Lines: 55 Commit 4dfb80d18d05 ("net: fec: cache statistics while device is down") introduced unconditional statistics-related actions. However, when driver is compiled with CONFIG_M5272, staticsics-related definitions do not exist, which results into build errors. Fix that by adding needed #if !defined(CONFIG_M5272). Fixes: 4dfb80d18d05 ("net: fec: cache statistics while device is down") Signed-off-by: Nikita Yushchenko --- drivers/net/ethernet/freescale/fec_main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 6a20c24a2003..89e902767abb 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2884,7 +2884,9 @@ fec_enet_close(struct net_device *ndev) if (fep->quirks & FEC_QUIRK_ERR006687) imx6q_cpuidle_fec_irqs_unused(); +#if !defined(CONFIG_M5272) fec_enet_update_ethtool_stats(ndev); +#endif fec_enet_clk_enable(ndev, false); pinctrl_pm_select_sleep_state(&fep->pdev->dev); @@ -3192,7 +3194,9 @@ static int fec_enet_init(struct net_device *ndev) fec_restart(ndev); +#if !defined(CONFIG_M5272) fec_enet_update_ethtool_stats(ndev); +#endif return 0; } @@ -3292,9 +3296,11 @@ fec_probe(struct platform_device *pdev) fec_enet_get_queue_num(pdev, &num_tx_qs, &num_rx_qs); /* Init network device */ - ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private) + - ARRAY_SIZE(fec_stats) * sizeof(u64), - num_tx_qs, num_rx_qs); + ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private) +#if !defined(CONFIG_M5272) + + ARRAY_SIZE(fec_stats) * sizeof(u64) +#endif + , num_tx_qs, num_rx_qs); if (!ndev) return -ENOMEM; -- 2.1.4