From patchwork Tue Jun 15 16:07:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 55739 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 762061015A5 for ; Wed, 16 Jun 2010 02:07:03 +1000 (EST) Received: from mail-fx0-f51.google.com (mail-fx0-f51.google.com [209.85.161.51]) by ozlabs.org (Postfix) with ESMTP id D7FEB1008FA; Wed, 16 Jun 2010 02:06:55 +1000 (EST) Received: by mail-fx0-f51.google.com with SMTP id 20so331649fxm.38 for ; Tue, 15 Jun 2010 09:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=ZWcwLxHlYiyVw9iayJvZvEaZXlskcRhP4QPMF1uVj4s=; b=T+6mye4GiCFxIiNA6HczXls1vt1WkUJ7VAP1iB/GwQSWvkZruVsHiLU35mM52om1Df CwwUy19MSunCsgQGkJ0ekImzZYfvvj7TulPCgoB3cUWNKSooWwaQV8sfOUXBhDGImi6U FW5Zu0cYENXqj5gpOIQI+WVsjyXKpgtbOGHcg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=HyqK2+jqHJuEErd5e0UiBsGwtTXW7XmOtHzXILf/VNp4JQnQIB7zB1t5Ks8a3qbtCM LgNRYmhTXjjaHluAxoHYINPuCpHDdtdOJzzMON8AMS5X3VFHfE1jfELxeCzAyMIpXj/1 KFE9OTgMTwa1ycrYBdTntql4+gVQY3/hyhiRc= Received: by 10.223.21.215 with SMTP id k23mr7520984fab.54.1276618015056; Tue, 15 Jun 2010 09:06:55 -0700 (PDT) Received: from riccoc20.at.omicron.at (vs162244.vserver.de [62.75.162.244]) by mx.google.com with ESMTPS id 27sm10087340faz.42.2010.06.15.09.06.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 15 Jun 2010 09:06:54 -0700 (PDT) Date: Tue, 15 Jun 2010 18:07:46 +0200 From: Richard Cochran To: netdev@vger.kernel.org Subject: [PATCH 02/12] phylib: do not filter phy_mii_ioctl() Message-ID: <4cd127a2aa2c40a1b573e079e0624f10d1d94867.1276615626.git.richard.cochran@omicron.at> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: devicetree-discuss@lists.ozlabs.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Krzysztof Halasa X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Two maverick drivers filter the ioctl commands passed to phy_mii_ioctl(). This is unnecessary since phylib will check the command in any case. Signed-off-by: Richard Cochran --- drivers/net/cpmac.c | 5 +---- drivers/net/stmmac/stmmac_main.c | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index d4c5ca4..0e47ca1 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c @@ -846,11 +846,8 @@ static int cpmac_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return -EINVAL; if (!priv->phy) return -EINVAL; - if ((cmd == SIOCGMIIPHY) || (cmd == SIOCGMIIREG) || - (cmd == SIOCSMIIREG)) - return phy_mii_ioctl(priv->phy, ifr, cmd); - return -EOPNOTSUPP; + return phy_mii_ioctl(priv->phy, ifr, cmd); } static int cpmac_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index 6af7471..acf0616 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c @@ -1437,24 +1437,18 @@ static void stmmac_poll_controller(struct net_device *dev) static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { struct stmmac_priv *priv = netdev_priv(dev); - int ret = -EOPNOTSUPP; + int ret; if (!netif_running(dev)) return -EINVAL; - switch (cmd) { - case SIOCGMIIPHY: - case SIOCGMIIREG: - case SIOCSMIIREG: - if (!priv->phydev) - return -EINVAL; - - spin_lock(&priv->lock); - ret = phy_mii_ioctl(priv->phydev, rq, cmd); - spin_unlock(&priv->lock); - default: - break; - } + if (!priv->phydev) + return -EINVAL; + + spin_lock(&priv->lock); + ret = phy_mii_ioctl(priv->phydev, rq, cmd); + spin_unlock(&priv->lock); + return ret; }