Skip to contentSkip to conversation

arch: mips: pci: cleanups and fixes for mt7620 driver

PATCH In review John Crispin 2 participants 5 messages Feb 20, 2017 – Nov 13, 2017

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

cover arch: mips: pci: cleanups and fixes for mt7620 driver

While updating the LEDE kernel to v4.9 i stumbled across a fw compile warnings. While fixing these warnings I also noticed that the BIT() macro was not used.

John Crispin (3):
arch: mips: pci: remove duplicate define in mt7620 driver
arch: mips: pci: remove KERN_WARN instance inside the mt7620 driver
arch: mips: pci: make use of the BIT() macro inside the mt7620 driver

 arch/mips/pci/pci-mt7620.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/3 arch: mips: pci: remove duplicate define in mt7620 driver

An invalid and duplicate define has gone unnoticed for some time. lets remove it. The correct define is 3 lines below.

---
 arch/mips/pci/pci-mt7620.c |    1 -
 1 file changed, 1 deletion(-)
arch/mips/pci/pci-mt7620.c +0 -1
index 628c513..3fdaf7c 100644
@@ -33,7 +33,6 @@
 #define RALINK_GPIOMODE			0x60
 
 #define PPLL_CFG1			0x9c
-#define PDRV_SW_SET			BIT(23)
 
 #define PPLL_DRV			0xa0
 #define PDRV_SW_SET			(1<<31)
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/3 arch: mips: pci: remove KERN_WARN instance inside the mt7620 driver

In reply to John Crispin

Switch the printk() call to the prefered pr_warn() api.

---
 arch/mips/pci/pci-mt7620.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/pci/pci-mt7620.c +1 -1
index 3fdaf7c..902fa61 100644
@@ -120,7 +120,7 @@ static int wait_pciephy_busy(void)
 		else
 			break;
 		if (retry++ > WAITRETRY_MAX) {
-			printk(KERN_WARN "PCIE-PHY retry failed.\n");
+			pr_warn("PCIE-PHY retry failed.\n");
 			return -1;
 		}
 	}
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/3 arch: mips: pci: make use of the BIT() macro inside the mt7620 driver

In reply to John Crispin

There are a few defines that manully shift a bit. Change these to using the BIT() macro.

---
 arch/mips/pci/pci-mt7620.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/mips/pci/pci-mt7620.c +6 -6
index 902fa61..68fd019 100644
@@ -35,11 +35,11 @@
 #define PPLL_CFG1			0x9c
 
 #define PPLL_DRV			0xa0
-#define PDRV_SW_SET			(1<<31)
-#define LC_CKDRVPD			(1<<19)
-#define LC_CKDRVOHZ			(1<<18)
-#define LC_CKDRVHZ			(1<<17)
-#define LC_CKTEST			(1<<16)
+#define PDRV_SW_SET			BIT(31)
+#define LC_CKDRVPD			BIT(19)
+#define LC_CKDRVOHZ			BIT(18)
+#define LC_CKDRVHZ			BIT(17)
+#define LC_CKTEST			BIT(16)
 
 /* PCI Bridge registers */
 #define RALINK_PCI_PCICFG_ADDR		0x00
@@ -65,7 +65,7 @@
 #define PCIEPHY0_CFG			0x90
 
 #define RALINK_PCIEPHY_P0_CTL_OFFSET	0x7498
-#define RALINK_PCIE0_CLK_EN		(1 << 26)
+#define RALINK_PCIE0_CLK_EN		BIT(26)
 
 #define BUSY				0x80000000
 #define WAITRETRY_MAX			10
Signature · 1 line
1.7.10.4
#4 lore raw
In reply to John Crispin
Quoted 8 lines · John Crispin

While updating the LEDE kernel to v4.9 i stumbled across a fw compile warnings. While fixing these warnings I also noticed that the BIT() macro was not used.

John Crispin (3):
arch: mips: pci: remove duplicate define in mt7620 driver
arch: mips: pci: remove KERN_WARN instance inside the mt7620 driver
arch: mips: pci: make use of the BIT() macro inside the mt7620 driver

Thanks, all applied.

Cheers
James

Quoted 7 lines
 arch/mips/pci/pci-mt7620.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.10.4