From 0fec65130b9f11a73d74f47025491f97f82ba070 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 5 May 2015 10:06:06 -0700 Subject: arcnet: com20020: Use arcnet_ routines Simplify and make consistent the current uses of inb/outb by using the newly introduced arcnet_ equivalents. o Add new #defines for register offsets There is an register offset, 8, that is unnamed and used as-is. o Remove old #defines that included the ioaddr o Remove obfuscating macros by expanding them in-place where appropriate o Create static inline com20020_set_subaddress for the SET_SUBADR macro There is an unused arcnet config entry CONFIGSA100_CT6001 which added a special #define BUS_ALIGN which was introduced but never used in fullhist git tree commit 22cfce4b82b0 ("[ARCNET]: Fixes.") in Nov 2004 for Linux v2.6.10. This BUS_ALIGN #define tries to allow 8 bit devices to work on a 16 bit bus by aligning addresses to 16 bit boundaries. Move this currently unused CONFIG_SA1100_CT6001 BUS_ALIGN macro from com20020.h to arcdevice.h. Signed-off-by: Joe Perches Signed-off-by: Michael Grzeschik --- drivers/net/arcnet/com20020-pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/arcnet/com20020-pci.c') diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c index 1a75a6982031..9b8212663320 100644 --- a/drivers/net/arcnet/com20020-pci.c +++ b/drivers/net/arcnet/com20020-pci.c @@ -117,8 +117,8 @@ static int com20020pci_probe(struct pci_dev *pdev, * ARCNET controller needs * this access to detect bustype */ - outb(0x00, ioaddr + 1); - inb(ioaddr + 1); + arcnet_outb(0x00, ioaddr, COM20020_REG_W_COMMAND); + arcnet_inb(ioaddr, COM20020_REG_R_DIAGSTAT); dev->base_addr = ioaddr; dev->dev_addr[0] = node; @@ -131,7 +131,7 @@ static int com20020pci_probe(struct pci_dev *pdev, lp->timeout = timeout; lp->hw.owner = THIS_MODULE; - if (ASTATUS() == 0xFF) { + if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) { pr_err("IO address %Xh is empty!\n", ioaddr); ret = -EIO; goto out_port; -- cgit v1.2.3