From patchwork Sun Mar 31 20:11:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2368671 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A41933FD40 for ; Sun, 31 Mar 2013 20:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755857Ab3CaUMb (ORCPT ); Sun, 31 Mar 2013 16:12:31 -0400 Received: from mail-la0-f41.google.com ([209.85.215.41]:59861 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755822Ab3CaUM2 (ORCPT ); Sun, 31 Mar 2013 16:12:28 -0400 Received: by mail-la0-f41.google.com with SMTP id fo12so1676058lab.0 for ; Sun, 31 Mar 2013 13:12:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:subject:cc:from:organization:date:mime-version :content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=zbOfvW44KXs1JHyIMDvxCs32qE4zvNXZyG/n4cTqqSk=; b=CxDvjmSf2OQRp1EN901F0yHgR5kSZRZu054xf5b6ZVOLQ/zDlEPAcOFHHu0+x/1eYw aXQ9cq9uv6golVdBHkRuB93GFsMnH7GnlcLWKYnNTYmqV2mTOHK5svuwO33qV7oAZOTW UWnmZ+53uQUlC5KWFddEiwdjhDFIPFm8CgizjJ20c4lZc2ORnsJKz/CJr0buTnaOUK0s FOF1XsPjTQHBfklzmu0PlcMdFPvz67AnLmKpToUx4s2VpvZ3mA6fFgWWPm2QO0VrmDge tSA6asGu6dvBFTMWAU9rjzUh7AcBhOpEWui8Lvc5ymtMOpL9Blhs43iq5CYsgoVWia6u Yn6Q== X-Received: by 10.152.46.12 with SMTP id r12mr4531309lam.15.1364760744685; Sun, 31 Mar 2013 13:12:24 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-90-168.pppoe.mtu-net.ru. [91.79.90.168]) by mx.google.com with ESMTPS id c7sm1288787lbe.6.2013.03.31.13.12.23 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 31 Mar 2013 13:12:23 -0700 (PDT) To: netdev@vger.kernel.org Subject: [PATCH] sh_eth: make 'link' field of 'struct sh_eth_private' *int* Cc: nobuhiro.iwamatsu.yj@renesas.com, linux-sh@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Mon, 1 Apr 2013 00:11:04 +0400 MIME-Version: 1.0 Message-Id: <201304010011.04950.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQlmRRzGKsGdGuZsBIJApfxIM3IXA4Sj2vzbarAAZGh3Jb0SsjzFc615bW8e2qnRY2DYCMUC Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org The 'link' field of 'struct sh_eth_private' has type 'enum phy_state' while the 'link' field of 'struct phy_device' is merely *int* (having values 0 and 1) and the former field gets assigned from the latter. Make the field match, getting rid of incorrectly used PHY_DOWN value in assignments/comparisons. Signed-off-by: Sergei Shtylyov --- The patch is against David Miller's 'net-next.git' repo. drivers/net/ethernet/renesas/sh_eth.c | 8 ++++---- drivers/net/ethernet/renesas/sh_eth.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1674,7 +1674,7 @@ static void sh_eth_adjust_link(struct ne struct phy_device *phydev = mdp->phydev; int new_state = 0; - if (phydev->link != PHY_DOWN) { + if (phydev->link) { if (phydev->duplex != mdp->duplex) { new_state = 1; mdp->duplex = phydev->duplex; @@ -1688,7 +1688,7 @@ static void sh_eth_adjust_link(struct ne if (mdp->cd->set_rate) mdp->cd->set_rate(ndev); } - if (mdp->link == PHY_DOWN) { + if (!mdp->link) { sh_eth_write(ndev, (sh_eth_read(ndev, ECMR) & ~ECMR_TXF), ECMR); new_state = 1; @@ -1696,7 +1696,7 @@ static void sh_eth_adjust_link(struct ne } } else if (mdp->link) { new_state = 1; - mdp->link = PHY_DOWN; + mdp->link = 0; mdp->speed = 0; mdp->duplex = -1; } @@ -1715,7 +1715,7 @@ static int sh_eth_phy_init(struct net_de snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, mdp->mii_bus->id , mdp->phy_id); - mdp->link = PHY_DOWN; + mdp->link = 0; mdp->speed = 0; mdp->duplex = -1; Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -503,7 +503,7 @@ struct sh_eth_private { u32 phy_id; /* PHY ID */ struct mii_bus *mii_bus; /* MDIO bus control */ struct phy_device *phydev; /* PHY device control */ - enum phy_state link; + int link; phy_interface_t phy_interface; int msg_enable; int speed;