From patchwork Tue Nov 3 19:22:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 315706 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UPPERCASE_50_75,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA97DC2D0A3 for ; Tue, 3 Nov 2020 19:22:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DEA7216C4 for ; Tue, 3 Nov 2020 19:22:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604431360; bh=jJsoyesVDSYVelMAArhDX0NsOSp89IP5P45MZ3MnLVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ST0PZwRllmy2eKvn4Kr4OMX93m5oW+6PK7JlbA1bUk2Fjf0jQ/jdUNLLxOyoB7i5z ryorFGtsGkwc901t3VjDtfwLTlf1wdfYl+TzlkxtCIDru1yYFD1JqYNWNykSdMfssl kBGSAFXk7n0os7u7/yPXr0a8eY+lVQdkkiizxBcY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729515AbgKCTWi (ORCPT ); Tue, 3 Nov 2020 14:22:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:58366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729316AbgKCTWd (ORCPT ); Tue, 3 Nov 2020 14:22:33 -0500 Received: from dellmb.labs.office.nic.cz (nat-1.nic.cz [217.31.205.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B676722264; Tue, 3 Nov 2020 19:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604431352; bh=jJsoyesVDSYVelMAArhDX0NsOSp89IP5P45MZ3MnLVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wUQP8PkCQ6iotGpSVnPxOp8nkgeiNd+aW7vV2niR+DZeZjvEuLq1CivkAm3AKPNZ2 XByuK1sCJnO9aLCrnEYdbEIkXmLRuvPAKq/ljEevz7NJrzkLKunuHI1lHAvrSz1on3 zJFWoKOOjRteE1ysR9nNsGKWtBfgIPrNAHXXFcdU= From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org Cc: linux-usb@vger.kernel.org, Hayes Wang , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 2/5] r8152: cosmetic improvement of product table macro Date: Tue, 3 Nov 2020 20:22:23 +0100 Message-Id: <20201103192226.2455-3-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201103192226.2455-1-kabel@kernel.org> References: <20201103192226.2455-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Improve macro REALTEK_USB_DEVICE cosmetically so that it defines complete members. Signed-off-by: Marek BehĂșn --- drivers/net/usb/r8152.c | 44 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 85dda591c838..96bef1c027f2 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -6862,33 +6862,31 @@ static void rtl8152_disconnect(struct usb_interface *intf) } #define REALTEK_USB_DEVICE(vend, prod) \ - USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC) \ -}, \ -{ \ - USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \ + { USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC) }, \ + { USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \ USB_CDC_SUBCLASS_ETHERNET, \ - USB_CDC_PROTO_NONE) + USB_CDC_PROTO_NONE) } /* table of devices that work with this driver */ static const struct usb_device_id rtl8152_table[] = { - {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050)}, - {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)}, - {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)}, - {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)}, - {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)}, - {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927)}, - {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041)}, - {REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff)}, - {REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601)}, + REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050), + REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152), + REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153), + REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab), + REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6), + REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927), + REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101), + REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f), + REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062), + REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069), + REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082), + REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205), + REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c), + REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214), + REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387), + REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041), + REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff), + REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601), {} }; From patchwork Tue Nov 3 19:22:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 315705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 477D0C388F7 for ; Tue, 3 Nov 2020 19:22:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2E5222264 for ; Tue, 3 Nov 2020 19:22:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604431372; bh=PrCfCR3gt8S7eJW0z4TD7GmNdG+8LYpd9sT+cnuK2dA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ImIHaBSgNknqMfZGVAnNSZ5LVURjSuQoTaxoiBGRX7Eck3Z1bzKO1mhR8r5JIjmMX b4h0BuR+Umb0Ige7hwZHwF8aiKOlpVtwbdWW9NVhEPHv4+PJxzxPt0yUKLW8BdIegj ruNv8m3apSJ6+MEuXqMh0OeHfM5k2ZWS4hvPhzqY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729570AbgKCTWm (ORCPT ); Tue, 3 Nov 2020 14:22:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:58396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729399AbgKCTWg (ORCPT ); Tue, 3 Nov 2020 14:22:36 -0500 Received: from dellmb.labs.office.nic.cz (nat-1.nic.cz [217.31.205.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B216421D91; Tue, 3 Nov 2020 19:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604431355; bh=PrCfCR3gt8S7eJW0z4TD7GmNdG+8LYpd9sT+cnuK2dA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EwYflywyEgYd1PWw/BL7P3crNe+EYKoD4wijUxiPS1uoG1a7V1Ja/bAYorC9mjCBW 68JV2PYgLDWxlpFFrR6BuP0nVpM/LYdNqvb9fAxAfSoWvyQKt4MI/CxcXg+tU9cREX w8cD77KmPfrsHgnclBgmuRSpA4bpO7Wj1DYF2Tcs= From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org Cc: linux-usb@vger.kernel.org, Hayes Wang , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 4/5] r8152: rename r8153_phy_status to r8153_phy_status_wait Date: Tue, 3 Nov 2020 20:22:25 +0100 Message-Id: <20201103192226.2455-5-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201103192226.2455-1-kabel@kernel.org> References: <20201103192226.2455-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The idea behind r8153_phy_status function is to wait till status is of desired value or (if desired value is zero) to wait till status if of non-zero value. Rename this function to r8153_phy_status_wait. Signed-off-by: Marek BehĂșn --- drivers/net/usb/r8152.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 905859309db4..1a427061da8e 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -3198,7 +3198,7 @@ static void r8153b_green_en(struct r8152 *tp, bool enable) tp->ups_info.green = enable; } -static u16 r8153_phy_status(struct r8152 *tp, u16 desired) +static u16 r8153_phy_status_wait(struct r8152 *tp, u16 desired) { u16 data; int i; @@ -3249,7 +3249,7 @@ static void r8153b_ups_en(struct r8152 *tp, bool enable) ocp_data &= ~PCUT_STATUS; usb_ocp_write_word(tp, USB_MISC_0, ocp_data); - data = r8153_phy_status(tp, 0); + data = r8153_phy_status_wait(tp, 0); switch (data) { case PHY_STAT_PWRDN: @@ -3262,7 +3262,7 @@ static void r8153b_ups_en(struct r8152 *tp, bool enable) data |= BMCR_RESET; r8152_mdio_write(tp, MII_BMCR, data); - data = r8153_phy_status(tp, PHY_STAT_LAN_ON); + data = r8153_phy_status_wait(tp, PHY_STAT_LAN_ON); fallthrough; default: @@ -5397,7 +5397,7 @@ static void r8153_init(struct r8152 *tp) break; } - data = r8153_phy_status(tp, 0); + data = r8153_phy_status_wait(tp, 0); if (tp->version == RTL_VER_03 || tp->version == RTL_VER_04 || tp->version == RTL_VER_05) @@ -5409,7 +5409,7 @@ static void r8153_init(struct r8152 *tp) r8152_mdio_write(tp, MII_BMCR, data); } - data = r8153_phy_status(tp, PHY_STAT_LAN_ON); + data = r8153_phy_status_wait(tp, PHY_STAT_LAN_ON); r8153_u2p3en(tp, false); @@ -5536,7 +5536,7 @@ static void r8153b_init(struct r8152 *tp) break; } - data = r8153_phy_status(tp, 0); + data = r8153_phy_status_wait(tp, 0); data = r8152_mdio_read(tp, MII_BMCR); if (data & BMCR_PDOWN) { @@ -5544,7 +5544,7 @@ static void r8153b_init(struct r8152 *tp) r8152_mdio_write(tp, MII_BMCR, data); } - data = r8153_phy_status(tp, PHY_STAT_LAN_ON); + data = r8153_phy_status_wait(tp, PHY_STAT_LAN_ON); r8153_u2p3en(tp, false);