Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758153Ab2B2PoJ (ORCPT ); Wed, 29 Feb 2012 10:44:09 -0500 Received: from wp188.webpack.hosteurope.de ([80.237.132.195]:38814 "EHLO wp188.webpack.hosteurope.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758117Ab2B2PnR (ORCPT ); Wed, 29 Feb 2012 10:43:17 -0500 From: Danny Kukawka To: "David S. Miller" Cc: Danny Kukawka , Paul Gortmaker , Alexey Dobriyan , Joe Perches , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] ethoc: add .ndo_validate_addr to net_device_ops Date: Wed, 29 Feb 2012 16:42:53 +0100 Message-Id: <1330530176-24952-6-git-send-email-danny.kukawka@bisect.de> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1330530176-24952-1-git-send-email-danny.kukawka@bisect.de> References: <1330530176-24952-1-git-send-email-danny.kukawka@bisect.de> X-bounce-key: webpack.hosteurope.de;danny.kukawka@bisect.de;1330530197;221c76fe; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1411 Lines: 40 Add eth_validate_addr() to .ndo_validate_addr to get validation checks in dev_set_mac_address() working. Remove is_valid_ether_addr() from ethoc_set_mac_address() to prevent double check. Signed-off-by: Danny Kukawka --- drivers/net/ethernet/ethoc.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c index a381678..ca80f19 100644 --- a/drivers/net/ethernet/ethoc.c +++ b/drivers/net/ethernet/ethoc.c @@ -776,9 +776,6 @@ static int ethoc_set_mac_address(struct net_device *dev, void *addr) struct ethoc *priv = netdev_priv(dev); u8 *mac = (u8 *)addr; - if (!is_valid_ether_addr(mac)) - return -EADDRNOTAVAIL; - ethoc_write(priv, MAC_ADDR0, (mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | (mac[5] << 0)); ethoc_write(priv, MAC_ADDR1, (mac[0] << 8) | (mac[1] << 0)); @@ -899,6 +896,7 @@ static const struct net_device_ops ethoc_netdev_ops = { .ndo_change_mtu = ethoc_change_mtu, .ndo_tx_timeout = ethoc_tx_timeout, .ndo_start_xmit = ethoc_start_xmit, + .ndo_validate_addr = eth_validate_addr, }; /** -- 1.7.8.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/