From patchwork Mon Nov 17 23:42:39 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 9285 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 19D0BDDED6 for ; Tue, 18 Nov 2008 11:01:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752928AbYKRABB (ORCPT ); Mon, 17 Nov 2008 19:01:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752343AbYKRAA6 (ORCPT ); Mon, 17 Nov 2008 19:00:58 -0500 Received: from suva.vyatta.com ([76.74.103.44]:55127 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369AbYKRAAY (ORCPT ); Mon, 17 Nov 2008 19:00:24 -0500 Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id mAI00Mac018231; Mon, 17 Nov 2008 16:00:22 -0800 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id mAI00Mab018230; Mon, 17 Nov 2008 16:00:22 -0800 Message-Id: <20081117234357.517904432@vyatta.com> References: <20081117234207.854110282@vyatta.com> User-Agent: quilt/0.46-1 Date: Mon, 17 Nov 2008 15:42:39 -0800 From: Stephen Hemminger To: David Miller Cc: netdev@vger.kernel.org Subject: [PATCH 32/33] niu: convert to net_device_ops Content-Disposition: inline; filename=niu-netdev_ops.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Convert this driver to network device ops. Compile tested only (give me hw!) Signed-off-by: Stephen Hemminger --- a/drivers/net/niu.c 2008-11-17 13:45:41.000000000 -0800 +++ b/drivers/net/niu.c 2008-11-17 13:48:46.000000000 -0800 @@ -8618,19 +8618,24 @@ static struct net_device * __devinit niu return dev; } +static const struct net_device_ops niu_netdev_ops = { + .open = niu_open, + .stop = niu_close, + .get_stats = niu_get_stats, + .set_multicast_list = niu_set_rx_mode, + .validate_addr = eth_validate_addr, + .set_mac_address = niu_set_mac_addr, + .do_ioctl = niu_ioctl, + .tx_timeout = niu_tx_timeout, + .change_mtu = niu_change_mtu, +}; + static void __devinit niu_assign_netdev_ops(struct net_device *dev) { - dev->open = niu_open; - dev->stop = niu_close; - dev->get_stats = niu_get_stats; - dev->set_multicast_list = niu_set_rx_mode; - dev->set_mac_address = niu_set_mac_addr; - dev->do_ioctl = niu_ioctl; - dev->tx_timeout = niu_tx_timeout; + dev->netdev_ops = &niu_netdev_ops; dev->hard_start_xmit = niu_start_xmit; dev->ethtool_ops = &niu_ethtool_ops; dev->watchdog_timeo = NIU_TX_TIMEOUT; - dev->change_mtu = niu_change_mtu; } static void __devinit niu_device_announce(struct niu *np)