Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp451539ybb; Sat, 28 Mar 2020 02:57:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv362gTO+Jd05IL7cpAIbQn8hClsjQ1Vw8ST8JOVJ5PPSrZ6h2iX4jb8jShwvHyk/vidV/9 X-Received: by 2002:a05:6830:239b:: with SMTP id l27mr2177975ots.278.1585389426744; Sat, 28 Mar 2020 02:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585389426; cv=none; d=google.com; s=arc-20160816; b=v/ZERLqUwxkV6OoCtxnk7DeVewFbyv22/i+elJijgtbVBYYmTBVeT81I3cGQBzdVl/ /otsjgJy9dIGWXyHTjdyLGJ0XxkN0CMinysJCnyhOqWgbrBRQ/hKMfG2ypcAPTsFn5zu HKx3NEj/pborXoDgJK1bt3EgVFRT6c5gzda9VNRrNpvGv87WN5LbMpQhNGaTnBFj5x0k L9JtHP116alCXkD8/kgqAODIe7JtHMwlX/G/z2/8I9HaM1HnYBk4GQqrU8YIbtHep9UG t+96IoqatKiF4E28cPdabvT0KKya29ipYAxuzsMTW5faR0zKyTSZkPpF4POT2f9c0rm3 w4pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ssHcPWTolY5MAXhKbbf0pc2w1R3HEBHbiEMjn6ToybM=; b=YZIb6QNl5pLBaIawkHllj5c5kuTzaBr4MdHEtB9XAMf2gXluJJRaL6qV56BpyqdpB6 mvZXvKkXoU811pmNJD19Su4s8h+YiUE/g8ZqEr8oMKWV6zxW9pIIBiH1dj9QdL6d5jSC QkrRZ9Jv1c3aqKNUIKYI+M63GU13VbOseAIhOjJIkZN3m/bk/bT0xuad8o0kZwZHGt6l nnjNQSedffjM4HuQnXRa+GVk6C8SLnkL5H01H+kEvEn8nka7ZrHMli6n2BMc5QHPzgoE iXGf/KTybQduSkBHhrN09uorMmBd8PFbliL1l5AGd/SazRK5HB/D93hoKS+AbG0hw1pB Z/Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=l6xPybgj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13si1193344oto.214.2020.03.28.02.56.52; Sat, 28 Mar 2020 02:57:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=l6xPybgj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726164AbgC1Jzc (ORCPT + 99 others); Sat, 28 Mar 2020 05:55:32 -0400 Received: from mout.gmx.net ([212.227.15.15]:40407 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbgC1Jzb (ORCPT ); Sat, 28 Mar 2020 05:55:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1585389319; bh=GF5fOQBU8LcGvDbPJpFKcu8Xuvl8GxKStGoxi7M1Hps=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=l6xPybgjMzn27Pf86wSYUTLvkQe3lOX0Ac9IXp8i+xeUrvHHLcEOpQbY/BzUe+GAj Z9nLiR1wFuhJfakOPuStiKkynGBVKgqNan42hvgj/rzX4MHqHOOX7Z+8J9wdmjZZKC Sk9Si+Dni+atCwarOcv2I0F/BqwvkP6RXvHtzvPA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([83.52.229.196]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MOzT4-1iss6U3upw-00PMkQ; Sat, 28 Mar 2020 10:55:19 +0100 From: Oscar Carter To: Forest Bond , Greg Kroah-Hartman Cc: Malcolm Priestley , Oscar Carter , Quentin Deslandes , Amir Mahdi Ghorbanian , Colin Ian King , Gabriela Bittencourt , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Dan Carpenter Subject: [PATCH] staging: vt6656: Use defines in vnt_mac_reg_bits_* functions Date: Sat, 28 Mar 2020 10:54:33 +0100 Message-Id: <20200328095433.7879-1-oscar.carter@gmx.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:812Pai66WVOzf4x7TeQ0az2SXkPT1AiBLUTVSXGCgdJkGxEFITZ 1XKFwyKGPvrKJiod7Lo4ekZPmjGk43JSxkUv3RbrsMEOSnIhmoRL/DVEZ1/T4EDA+8Mqk/H NqxxP2nbuxydqaEDFr7WbeUKA24KwB5MmcIRFd+sfi9rVPCPltxzOpHBdxyQWJdIPay5/LS U4VaIOP0XAo42qFr4iWVA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:hq4z73EcVdM=:5j1xCcPsUIvjTogKmTYrNy rRT0DDOQcFGWAd1rZAz5mecZdBwCNvhD6c9Q8Zvgids10YDrSQxW1q8kPKvW5r6fhxOKRwjRa 4YkcNbUIDj9MUqajUI45EWvddWT/xKrPxc/g7I9uuzw4yucOi0X1blUYnNNqv/4vFkkY2FV+K 7r+u77MM8hFHz67dupt3qhtJsidQ837wvadPG2BVkD86xWB/Vsh/webwc/l/bm8ohevObIsUH spoB93a+icJY/DHkXtGAtLIxOt1wSn2wQCEcWkFOePXUqnaal9KbxTXrqjmjENkGPfUCBd6sg 1vGNMH1DLGjuZ5pSryioAZM9K3XxMuMk9E6f9HHEUDxuvCzTIT8uvTG2bTbff8v3mbFCu+CS9 q52QssciNwIhBrqTxYTVcptlRXil6nVDaMaLqYrDTCPAlrK7TFB75vLBjzjhyhn0gVRZK8l8J FS12/Xg817ijeYPnD+O3XQzySJOAqAGOr3yDI3TD8p1BoyvXpOTEGVGgSxUfKAhEJdNyTZaIQ 8dTPGOAGP3OjUA1RLno1/7chavtWDkn+OPKiJMJUF1C5SadY5qLXwfsrZesp06oYjQaUO7ksf 6z5EsV+cmUAXaCTQWGuDhDES3d1K9xBZk8zCrilkzpnVDfAVn+PxKTAjjKdL9mudmKI1woMaC TZzV4x1mfQ99HViwccfxBd3KVeL9NwY54R/Q6uatkI/S4mzQ/daEbLzwXzts3rX9ozQIa2Ppy s+IwUlhoL2SLx7xFCT0ErUxqsm/5VXKPGzXXZ7KePx+HTqmedAtBejLR7cwpPoQU31TDB3jJ0 1NWTnmDbx9sQiJtKX7liYhXhOKcRfddT4bhtdJ+WmEzmHYYp1su1JLp7TgeXJgd9dd2fIGNfP AXz/WhlwTt3Kr8SGES5gCyeKkZhRo5us/qhqmkpOZLiqS5CysrKUvaIqOLzg8XEHrD9urFnOb 6IOndMOHnGNgvyfN+FOYhlEzdWLHCN/hf2k1coagkMI4yqDbapDr8ecRWXqWYxJgT8ueiB26t fyl8mCEZv4zikeTbM42eVr7tboyoWT37Klg97c91EXFB8fKHiXMk4MhODzIO+Oxpfqf8f+w/9 dIDoLdgHMp9EZOYBpRPgnI+1KTjRF/11DlPreE/cJzYQf+wG5603EhSFfKAbGkWAe/l7POWB4 m2GRnN0LotDezwAdwvaYNjFRGTjXv0HNHMPatlsIb5RL6hYFpKproGLdVruE99j2sUCWrWU9+ Ufxa8g3mRd9goKULo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Define the necessary bits in the CHANNEL, PAPEDELAY and GPIOCTL0 registers to can use them in the calls to vnt_mac_reg_bits_on and vnt_mac_reg_bits_off functions. In this way, avoid the use of BIT() macros and clarify the code. Fixes: 3017e587e368 ("staging: vt6656: Use BIT() macro in vnt_mac_reg_bits= _* functions") Suggested-by: Dan Carpenter Signed-off-by: Oscar Carter =2D-- drivers/staging/vt6656/baseband.c | 6 ++++-- drivers/staging/vt6656/card.c | 3 +-- drivers/staging/vt6656/mac.h | 12 ++++++++++++ drivers/staging/vt6656/main_usb.c | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/ba= seband.c index a19a563d8bcc..dd3c3bf5e8b5 100644 =2D-- a/drivers/staging/vt6656/baseband.c +++ b/drivers/staging/vt6656/baseband.c @@ -442,7 +442,8 @@ int vnt_vt3184_init(struct vnt_private *priv) if (ret) goto end; - ret =3D vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY, BIT(0)); + ret =3D vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY, + PAPEDELAY_B0); if (ret) goto end; } else if (priv->rf_type =3D=3D RF_VT3226D0) { @@ -451,7 +452,8 @@ int vnt_vt3184_init(struct vnt_private *priv) if (ret) goto end; - ret =3D vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY, BIT(0)); + ret =3D vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY, + PAPEDELAY_B0); if (ret) goto end; } diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index dc3ab10eb630..b88de0042b9d 100644 =2D-- a/drivers/staging/vt6656/card.c +++ b/drivers/staging/vt6656/card.c @@ -64,8 +64,7 @@ void vnt_set_channel(struct vnt_private *priv, u32 conne= ction_channel) vnt_mac_reg_bits_on(priv, MAC_REG_MACCR, MACCR_CLRNAV); /* Set Channel[7] =3D 0 to tell H/W channel is changing now. */ - vnt_mac_reg_bits_off(priv, MAC_REG_CHANNEL, - (BIT(7) | BIT(5) | BIT(4))); + vnt_mac_reg_bits_off(priv, MAC_REG_CHANNEL, CHANNEL_B7_B5_B4); vnt_control_out(priv, MESSAGE_TYPE_SELECT_CHANNEL, connection_channel, 0, 0, NULL); diff --git a/drivers/staging/vt6656/mac.h b/drivers/staging/vt6656/mac.h index c532b27de37f..f61b6595defb 100644 =2D-- a/drivers/staging/vt6656/mac.h +++ b/drivers/staging/vt6656/mac.h @@ -295,11 +295,20 @@ #define BBREGCTL_REGR BIT(1) #define BBREGCTL_REGW BIT(0) +/* Bits in the CHANNEL register */ +#define CHANNEL_B7 BIT(7) +#define CHANNEL_B5 BIT(5) +#define CHANNEL_B4 BIT(4) +#define CHANNEL_B7_B5_B4 (CHANNEL_B7 | CHANNEL_B5 | CHANNEL_B4) + /* Bits in the IFREGCTL register */ #define IFREGCTL_DONE BIT(2) #define IFREGCTL_IFRF BIT(1) #define IFREGCTL_REGW BIT(0) +/* Bits in the PAPEDELAY register */ +#define PAPEDELAY_B0 BIT(0) + /* Bits in the SOFTPWRCTL register */ #define SOFTPWRCTL_RFLEOPT BIT(3) #define SOFTPWRCTL_TXPEINV BIT(1) @@ -311,6 +320,9 @@ #define SOFTPWRCTL_SWPE1 BIT(1) #define SOFTPWRCTL_SWPE3 BIT(0) +/* Bits in the GPIOCTL0 register */ +#define GPIOCTL0_B0 BIT(0) + /* Bits in the GPIOCTL1 register */ #define GPIO3_MD BIT(5) #define GPIO3_DATA BIT(6) diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/ma= in_usb.c index 8e7269c87ea9..aa9c1fccc134 100644 =2D-- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -366,7 +366,7 @@ static int vnt_init_registers(struct vnt_private *priv= ) if (ret) goto end; - ret =3D vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL0, BIT(0)); + ret =3D vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL0, GPIOCTL0_B0); if (ret) goto end; =2D- 2.20.1