From patchwork Thu May 11 17:57:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 9722689 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 90F0360231 for ; Thu, 11 May 2017 17:58:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92727286EB for ; Thu, 11 May 2017 17:58:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87545286EE; Thu, 11 May 2017 17:58:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F23B286EB for ; Thu, 11 May 2017 17:58:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933492AbdEKR6F (ORCPT ); Thu, 11 May 2017 13:58:05 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34634 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932376AbdEKR6D (ORCPT ); Thu, 11 May 2017 13:58:03 -0400 Received: by mail-wm0-f68.google.com with SMTP id d127so8656750wmf.1; Thu, 11 May 2017 10:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4QBuV01bJmfU5pF5iMe3tcCfmxxXMMjFCsthbPPeHms=; b=I0YOeJA/8FlO64d07KI/OSu4u+4BJyAVCtfe4HMvd4nVxqVudw1TJRGC6oFpmz1gdJ ueVrVOoSBpeP4GjLQfZvutrEivHWoW95VchVEsSCAC2bTR4suhab4SENEspYr5BBBuLt 8CEqpXC7qhPL5/F6gG735gduaFHNALgDMeuSQPjMDVkTIPpmuTmq1SnVg0dE5KPTJVsQ 3AlyHKA5v7LS7qUWJ+ZFO5XCKWz/PpQReDC4vYnthSVDX5Ka8+A3Et10MBvi3vgprYUE W2KbZjoCtdX2v+aqi4h64dbl0U4CoaNLP4t5V1HdFk/pBs7Da10HRWdbJ6p3x9AOPXvc e4lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4QBuV01bJmfU5pF5iMe3tcCfmxxXMMjFCsthbPPeHms=; b=g1UH1uFYqvdtWJ+kkl1L/p2ADkZ4fUWhK4pMbwk/4HCpcBvH6sdw5LF0NZ7zOdWdXO /6WUsolCOyf52XQNZ09OeCtEFQsrKZJ0Ud1VIIsAUNYBBXYblsSsBb53fSfmrItfCylX sPbNsN98dvEr0EhFDTTf9IAKF/9dFmlz3oSSl/Gqc0WUQkQiGS5mL9KlhCEo9of9U668 g4Nx/cqc10QLgpAUuVGPPW/SfBsyFfzrBFh/tFOLm+F4mTWD9L3U+8GrSUbjH+q+ZM/7 MTKGHqtlnpoC5LpSH3vxwvtVb+1eUlp0aaMLVwbyYB7vbDSZ+D+Dw52r9DsUdlGDFbC9 SSSw== X-Gm-Message-State: AODbwcDQRoD5crOFcPerwKRMwT26CDHXJtHh5d8q52SkLz+qf5v4TnpY qj7imRd6WyCJVg== X-Received: by 10.28.199.10 with SMTP id x10mr7117wmf.83.1494525481771; Thu, 11 May 2017 10:58:01 -0700 (PDT) Received: from localhost.localdomain (92.40.248.21.threembb.co.uk. [92.40.248.21]) by smtp.gmail.com with ESMTPSA id u4sm1271084wmu.0.2017.05.11.10.58.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 10:58:01 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Malcolm Priestley , stable@vger.kernel.org Subject: [PATCH v2 3/4] staging: rtl8192e: rtl92e_get_eeprom_size Fix read size of EPROM_CMD. Date: Thu, 11 May 2017 18:57:45 +0100 Message-Id: <20170511175746.12378-3-tvboxspy@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170511175746.12378-1-tvboxspy@gmail.com> References: <20170511175746.12378-1-tvboxspy@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP EPROM_CMD is 2 byte aligned on PCI map so calling with rtl92e_readl will return invalid data so use rtl92e_readw. The device is unable to select the right eeprom type. Signed-off-by: Malcolm Priestley Cc: --- v2 - Fix typo in subject line drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index e03d0a3a6dcc..1c6ed5b2a6f9 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -625,7 +625,7 @@ void rtl92e_get_eeprom_size(struct net_device *dev) struct r8192_priv *priv = rtllib_priv(dev); RT_TRACE(COMP_INIT, "===========>%s()\n", __func__); - curCR = rtl92e_readl(dev, EPROM_CMD); + curCR = rtl92e_readw(dev, EPROM_CMD); RT_TRACE(COMP_INIT, "read from Reg Cmd9346CR(%x):%x\n", EPROM_CMD, curCR); priv->epromtype = (curCR & EPROM_CMD_9356SEL) ? EEPROM_93C56 :