From patchwork Mon Apr 22 05:03:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crag Wang X-Patchwork-Id: 10910643 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BABAB1575 for ; Mon, 22 Apr 2019 05:04:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EAF8281C3 for ; Mon, 22 Apr 2019 05:04:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CBBC28249; Mon, 22 Apr 2019 05:04:57 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 5AD91281C3 for ; Mon, 22 Apr 2019 05:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726233AbfDVFEW (ORCPT ); Mon, 22 Apr 2019 01:04:22 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46176 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725927AbfDVFEW (ORCPT ); Mon, 22 Apr 2019 01:04:22 -0400 Received: by mail-pf1-f195.google.com with SMTP id 9so5123513pfj.13; Sun, 21 Apr 2019 22:04:22 -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:mime-version :content-transfer-encoding; bh=nsMmiC7jhSKTFlhgcEpu4yxQzWbtu7ogv5Doohyfyhc=; b=O897wwR5sSHdszjTGLUArhG7+M6XZAfs4T3tCp2tl2beeeoNSwHcLtcIAcgpC9kJ4B eAOkpvGWAR+N7H3OpCh5eP3ANc5jwVI0VJPC04qBJK9PgI7x/PlsLgmIek1O4nO6JT/Y 1Ju0H5EQYsMC4XH89En3loHtiqrTR2UuoUi8GjLpUjOux6mxgy6iOAolsSpbS1MDOU/E gX3AQFp9x+CDO4OxmjA6FXkgc3JwTvztVhNvoycVmbZXbzJYdS/e5tEtmz+vnqS5SzXM SM7CxSQGKszAxGPIoj/Q7AM26PO1nP7CTwfNE0XjaCRt8BUb1SjKTHm+nKtxriKeyQ5e XHSw== 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:mime-version :content-transfer-encoding; bh=nsMmiC7jhSKTFlhgcEpu4yxQzWbtu7ogv5Doohyfyhc=; b=KTaWyxpdMqaUfDTHdC7JwNUnZy8xD163JkzyGItMMowvK4G+pJ6+YYtl6rTCbk/18x 9dLSXNQY4qfNfuvid6wG3C2LBHQXZ8vviDuY1uYkNwVPnkl7KTjkWN+QhYJakWj4Blx6 LfGPEJebZyu351+uV2zHNg8x/ReH1M7KPT9ehZRL81tdM1Zl24YnDlFd0dmrqCI8E8VL TnjgXwtplc5aihpCNjjzp0Q4XnJiZUi1DvazvWGim2DWAXus1JANrSKyVcpYWE6gJAUH SI4XDETx6DyGkwZCmBZ9LBAIdJzc4S89uxTpHvWGJCvz1IvaGGbs/tuaa5d/Ve5fZQRA CIKA== X-Gm-Message-State: APjAAAX6TydtAzWYelL1aWySW68ZqtIgIVR0eqbybPhBEfpcmftnjapD R/1JeCcaWtlDiEZxgpMeui0D9BddhwLkYQ== X-Google-Smtp-Source: APXvYqz1m4xyKyT7tpHFVEIrxRTHDMPP04U1aV6vk1oh821HmIXL4FBqng/d+Ir/VptUpGXqKaJhdQ== X-Received: by 2002:a63:f64f:: with SMTP id u15mr8734681pgj.192.1555909461379; Sun, 21 Apr 2019 22:04:21 -0700 (PDT) Received: from localhost.localdomain ([132.237.175.246]) by smtp.gmail.com with ESMTPSA id y8sm16192332pgk.20.2019.04.21.22.04.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Apr 2019 22:04:20 -0700 (PDT) From: crag0715@gmail.com To: linux-usb@vger.kernel.org, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, hayeswang@realtek.com, mario_limonciello@dell.com, crag0715@gmail.com, "Crag.Wang" , "David S. Miller" , Simon Glass , Grant Grundler , Sean Paul , David Chen , Kai-Heng Feng , "Gustavo A. R. Silva" , Charles Hyde , Sebastian Andrzej Siewior , zhong jiang Subject: [PATCH v2 1/1] r8152: sync sa_family with the media type of network device Date: Mon, 22 Apr 2019 13:03:43 +0800 Message-Id: <20190422050344.24513-1-crag0715@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Crag.Wang" Without this patch the socket address family sporadically gets wrong value ends up the dev_set_mac_address() fails to set the desired MAC address. Signed-off-by: Crag.Wang Reviewed-by: Jakub Kicinski Reviewed-By: Mario Limonciello --- drivers/net/usb/r8152.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 4c63b40d5e00..41fb39ce69c9 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -1225,6 +1225,8 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa) struct net_device *dev = tp->netdev; int ret; + sa->sa_family = dev->type; + if (tp->version == RTL_VER_01) { ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data); } else {