From patchwork Thu Apr 11 14:40:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 235766 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 272262C00AD for ; Fri, 12 Apr 2013 00:41:34 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161156Ab3DKOl2 (ORCPT ); Thu, 11 Apr 2013 10:41:28 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:43359 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932712Ab3DKOl0 (ORCPT ); Thu, 11 Apr 2013 10:41:26 -0400 Received: by mail-pa0-f51.google.com with SMTP id jh10so931528pab.24 for ; Thu, 11 Apr 2013 07:41:25 -0700 (PDT) X-Received: by 10.66.158.232 with SMTP id wx8mr9917182pab.156.1365691285494; Thu, 11 Apr 2013 07:41:25 -0700 (PDT) Received: from localhost ([183.37.202.117]) by mx.google.com with ESMTPS id a20sm4451976pbu.37.2013.04.11.07.41.22 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Apr 2013 07:41:24 -0700 (PDT) From: Ming Lei To: "David S. Miller" , Greg Kroah-Hartman Cc: Oliver Neukum , netdev@vger.kernel.org, linux-usb@vger.kernel.org, Ming Lei Subject: [PATCH 05/11] usbnet: asix: apply usbnet_link_change Date: Thu, 11 Apr 2013 22:40:34 +0800 Message-Id: <1365691240-816-6-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1365691240-816-1-git-send-email-ming.lei@canonical.com> References: <1365691240-816-1-git-send-email-ming.lei@canonical.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use usbnet_link_change to handle link change centrally. Signed-off-by: Ming Lei --- drivers/net/usb/asix_devices.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index 7097534..ad5d1e4 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -55,11 +55,7 @@ static void asix_status(struct usbnet *dev, struct urb *urb) event = urb->transfer_buffer; link = event->link & 0x01; if (netif_carrier_ok(dev->net) != link) { - if (link) { - netif_carrier_on(dev->net); - usbnet_defer_kevent (dev, EVENT_LINK_RESET ); - } else - netif_carrier_off(dev->net); + usbnet_link_change(dev, link, 1); netdev_dbg(dev->net, "Link Status is: %d\n", link); } }