Skip to contentSkip to conversation

net: ethernet: atheros: atlx: Use PCI generic definitions instead of private duplicates

PATCH New Puranjay Mohan 2 participants 4 messages Jun 22, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover net: ethernet: atheros: atlx: Use PCI generic definitions instead of private duplicates

This patch series removes the private duplicates of PCI definitions in favour of generic definitions defined in pci_regs.h.

Changes in v2:
Removed local PCI definitions of PCI_COMMAND_IO, PCI_COMMAND_MASTER, etc. which were left in v1.

Puranjay Mohan (3):
net: ethernet: atheros: atlx: Rename local PCI defines to generic
names
net: ethernet: atheros: atlx: Include generic PCI definitions
net: ethernet: atheros: atlx: Remove unused and private PCI
definitions

 drivers/net/ethernet/atheros/atlx/atl2.c | 11 ++++++-----
 drivers/net/ethernet/atheros/atlx/atl2.h |  7 -------
 drivers/net/ethernet/atheros/atlx/atlx.h |  5 -----
 3 files changed, 6 insertions(+), 17 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/3 net: ethernet: atheros: atlx: Rename local PCI defines to generic names

Rename all local PCI definitons to Generic PCI definitions to make them compatible with generic definitions present in pci_regs.h

Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>
---
 drivers/net/ethernet/atheros/atlx/atl2.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/atheros/atlx/atl2.c +5 -5
index 3a3fb5ce0fee..3b9fa27cc459 100644
@@ -2103,13 +2103,13 @@ static s32 atl2_reset_hw(struct atl2_hw *hw)
 	int i;
 
 	/* Workaround for PCI problem when BIOS sets MMRBC incorrectly. */
-	atl2_read_pci_cfg(hw, PCI_REG_COMMAND, &pci_cfg_cmd_word);
+	atl2_read_pci_cfg(hw, PCI_COMMAND, &pci_cfg_cmd_word);
 	if ((pci_cfg_cmd_word &
-		(CMD_IO_SPACE|CMD_MEMORY_SPACE|CMD_BUS_MASTER)) !=
-		(CMD_IO_SPACE|CMD_MEMORY_SPACE|CMD_BUS_MASTER)) {
+		(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER)) !=
+		(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER)) {
 		pci_cfg_cmd_word |=
-			(CMD_IO_SPACE|CMD_MEMORY_SPACE|CMD_BUS_MASTER);
-		atl2_write_pci_cfg(hw, PCI_REG_COMMAND, &pci_cfg_cmd_word);
+			(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
+		atl2_write_pci_cfg(hw, PCI_COMMAND, &pci_cfg_cmd_word);
 	}
 
 	/* Clear Interrupt mask to stop board from generating
Signature · 1 line
2.21.0
#2 lore raw

PATCH v2 2/3 net: ethernet: atheros: atlx: Include generic PCI definitions

In reply to Puranjay Mohan

Include the uapi/linux/pci_regs.h header file which contains the generic PCI defines.

Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>
---
 drivers/net/ethernet/atheros/atlx/atl2.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/atheros/atlx/atl2.c +1 -0
index 3b9fa27cc459..c69cb5f14001 100644
@@ -24,6 +24,7 @@
 #include <linux/netdevice.h>
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
+#include <linux/pci_regs.h>
 #include <linux/pm.h>
 #include <linux/skbuff.h>
 #include <linux/slab.h>
Signature · 1 line
2.21.0
#3 lore raw

PATCH v2 3/3 net: ethernet: atheros: atlx: Remove unused and private PCI definitions

In reply to Puranjay Mohan

Remove unused private PCI definitions from local headers, because generic PCI symbols are already included from pci_regs.h.

Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>
---
 drivers/net/ethernet/atheros/atlx/atl2.h | 7 -------
 drivers/net/ethernet/atheros/atlx/atlx.h | 5 -----
 2 files changed, 12 deletions(-)
drivers/net/ethernet/atheros/atlx/atl2.h +0 -7
index d97613bd15d5..9b5807efc734 100644
@@ -32,8 +32,6 @@
 int ethtool_ioctl(struct ifreq *ifr);
 #endif
 
-#define PCI_COMMAND_REGISTER	PCI_COMMAND
-#define CMD_MEM_WRT_INVALIDATE	PCI_COMMAND_INVALIDATE
 
 #define ATL2_WRITE_REG(a, reg, value) (iowrite32((value), \
 	((a)->hw_addr + (reg))))
@@ -201,11 +199,6 @@ static void atl2_force_ps(struct atl2_hw *hw);
 #define MII_DBG_ADDR	0x1D
 #define MII_DBG_DATA	0x1E
 
-/* PCI Command Register Bit Definitions */
-#define PCI_REG_COMMAND		0x04
-#define CMD_IO_SPACE		0x0001
-#define CMD_MEMORY_SPACE	0x0002
-#define CMD_BUS_MASTER		0x0004
 
 #define MEDIA_TYPE_100M_FULL	1
 #define MEDIA_TYPE_100M_HALF	2
drivers/net/ethernet/atheros/atlx/atlx.h +0 -5
index 7f5d4e24eb9f..9647ec8be994 100644
@@ -444,11 +444,6 @@
 #define MII_DBG_ADDR			0x1D
 #define MII_DBG_DATA			0x1E
 
-/* PCI Command Register Bit Definitions */
-#define PCI_REG_COMMAND			0x04	/* PCI Command Register */
-#define CMD_IO_SPACE			0x0001
-#define CMD_MEMORY_SPACE		0x0002
-#define CMD_BUS_MASTER			0x0004
 
 /* Wake Up Filter Control */
 #define ATLX_WUFC_LNKC	0x00000001	/* Link Status Change Wakeup Enable */
Signature · 1 line
2.21.0