From patchwork Tue Jan 15 05:39:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 14036 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9982724229 for ; Tue, 15 Jan 2013 05:47:35 +0000 (UTC) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by fiordland.canonical.com (Postfix) with ESMTP id 4D59AA19223 for ; Tue, 15 Jan 2013 05:47:35 +0000 (UTC) Received: by mail-vc0-f169.google.com with SMTP id gb23so4305156vcb.14 for ; Mon, 14 Jan 2013 21:47:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=/DZjTN4ebRw8OpbiIp/HNz2slLu5aeVSF8II+n6YXDo=; b=PN5We9JXJN56LqH5ZLHznCvxiDcY/K9fLMeqtdLdeAWpOYAVDYUMh0aO9tC8nMy0dJ HFKsAhq39bE804FxvfibfNlR0t4PTOIfVb4JaP2aADQLiaAb+URdgYM8JgIT25M+8bfQ m6gVb7HKuVHY/9DqQ4HkLx3dWZnpuwS2py6oXuwK1wyVMqdPNKSDBu4JNNpwHufq5vv4 QUpqkqLLdsNZeAvdm1CBRahSD9zbm3qqixnOnDvZ+BiQ4sdrnIR4WXQ8qByq7LrbQQst 2XrodRDeNjzVivbcZg9GIdghiSEgADlDyk9W7jfLvjsx6JYm9N1W1dFqQkxcJ4VCdlBY Ta/Q== X-Received: by 10.52.88.168 with SMTP id bh8mr89095646vdb.51.1358228854635; Mon, 14 Jan 2013 21:47:34 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp95815veb; Mon, 14 Jan 2013 21:47:33 -0800 (PST) X-Received: by 10.68.254.195 with SMTP id ak3mr87547986pbd.37.1358228852196; Mon, 14 Jan 2013 21:47:32 -0800 (PST) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by mx.google.com with ESMTPS id ak3si16534918pbd.65.2013.01.14.21.47.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jan 2013 21:47:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.220.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-pa0-f41.google.com with SMTP id bj3so2703618pad.14 for ; Mon, 14 Jan 2013 21:47:31 -0800 (PST) X-Received: by 10.68.235.200 with SMTP id uo8mr70522468pbc.29.1358228851338; Mon, 14 Jan 2013 21:47:31 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id uh9sm6905161pbc.65.2013.01.14.21.47.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 14 Jan 2013 21:47:29 -0800 (PST) From: Tushar Behera To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: gregkh@linuxfoundation.org, jacmet@sunsite.dk, patches@linaro.org, Ming Lei Subject: [PATCH] usbnet: dm9601: Fix incorrect command Date: Tue, 15 Jan 2013 11:09:01 +0530 Message-Id: <1358228341-2104-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQm6KBnB6wj6XstbSOV45fRrcEdo63at+/XHaINOfH4ex1P5IG6ZL9QVFIGnyoMAh9ZRHJl5 commit 24b1042c4eb2 ("usbnet: dm9601: apply introduced usb command APIs") removes the distiction between DM_WRITE_REG and DM_WRITE_REGS command. The distiction is reintroduced to the driver so that the functionality of the driver remains same. CC: Ming Lei Signed-off-by: Tushar Behera --- drivers/net/usb/dm9601.c | 22 ++++++---------------- 1 files changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 3f554c1..011410f 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c @@ -53,7 +53,6 @@ #define DM_RX_OVERHEAD 7 /* 3 byte header + 4 byte crc tail */ #define DM_TIMEOUT 1000 - static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data) { int err; @@ -84,32 +83,23 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value) { - return usbnet_write_cmd(dev, DM_WRITE_REGS, + return usbnet_write_cmd(dev, DM_WRITE_REG, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, value, reg, NULL, 0); } -static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, - u16 length, void *data) +static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data) { usbnet_write_cmd_async(dev, DM_WRITE_REGS, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, - value, reg, data, length); -} - -static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data) -{ - netdev_dbg(dev->net, "dm_write_async() reg=0x%02x length=%d\n", reg, length); - - dm_write_async_helper(dev, reg, 0, length, data); + 0, reg, data, length); } static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value) { - netdev_dbg(dev->net, "dm_write_reg_async() reg=0x%02x value=0x%02x\n", - reg, value); - - dm_write_async_helper(dev, reg, value, 0, NULL); + usbnet_write_cmd_async(dev, DM_WRITE_REG, + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, + value, reg, NULL, 0); } static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *value)