From patchwork Wed Sep 4 18:26:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 272695 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 20EC52C008F for ; Thu, 5 Sep 2013 04:25:15 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755007Ab3IDSZJ (ORCPT ); Wed, 4 Sep 2013 14:25:09 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:62623 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752626Ab3IDSZH (ORCPT ); Wed, 4 Sep 2013 14:25:07 -0400 Received: by mail-pa0-f48.google.com with SMTP id kp13so765539pab.21 for ; Wed, 04 Sep 2013 11:25:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=seU6J64dciEsf4ye5nfba/ttjwhuZXRo/TY3cETfq5Y=; b=PsKvp4xiTudFLX8N54cYjDbMmDUqtTQb15mjtrDhDgcfdwkhbJjRaNce/huTQqNDy/ I8MbsPjndQjgpCnpcsvAtGGdMk01Zh1MlyxrAAdgV/Tj9QpNIqfYGRa2EEh6IJxaU76v +c1hdfCooRTgFh4xz2dMEUBMwV8cKNM1teAiV4kOqfcjYYazVO/ZlVbOabdSZaIouB1r Wx6Vvt52+oiXdzMU5QuRYfWGmWow6I+y1VcGZjeg5CQ/UiiQd1iGD8SgLbGNp/wzTFlW G88bopOKghTNoLC/iYr7oOpI9znO4TumB2f5Z/ySdxkh4EER3A2+Gc76JjD0ycp/8kOI loeg== X-Gm-Message-State: ALoCoQkUecVKu8GWuB3yaYkoDBh27muKyA5fkkBX7RHwdleXWvP4/MPB2lm2FmCVWtpG0uSE4Amd X-Received: by 10.68.76.101 with SMTP id j5mr4783234pbw.67.1378319107402; Wed, 04 Sep 2013 11:25:07 -0700 (PDT) Received: from scylla (97-117-228-238.phnx.qwest.net. [97.117.228.238]) by mx.google.com with ESMTPSA id lm2sm32352991pab.2.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Sep 2013 11:25:06 -0700 (PDT) Received: by scylla (sSMTP sendmail emulation); Wed, 04 Sep 2013 11:26:01 -0700 From: Jon Mason To: netdev@vger.kernel.org Cc: Francois Romieu , Sorbica Shieh Subject: [PATCH] icplus: Use netif_running to determine device state Date: Wed, 4 Sep 2013 11:26:01 -0700 Message-Id: <1378319161-18850-1-git-send-email-jdmason@kudzu.us> X-Mailer: git-send-email 1.7.10.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Remove the __LINK_STATE_START check to verify the device is running, in favor of netif_running(). netif_running() performs the same check of __LINK_STATE_START, so the code should behave the same. Signed-off-by: Jon Mason Cc: Francois Romieu Cc: Sorbica Shieh --- drivers/net/ethernet/icplus/ipg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/icplus/ipg.c b/drivers/net/ethernet/icplus/ipg.c index 1fde90b..bdf5023 100644 --- a/drivers/net/ethernet/icplus/ipg.c +++ b/drivers/net/ethernet/icplus/ipg.c @@ -1004,7 +1004,7 @@ static struct net_device_stats *ipg_nic_get_stats(struct net_device *dev) /* Check to see if the NIC has been initialized via nic_open, * before trying to read statistic registers. */ - if (!test_bit(__LINK_STATE_START, &dev->state)) + if (!netif_running(dev)) return &sp->stats; sp->stats.rx_packets += ipg_r32(IPG_FRAMESRCVDOK);