[PATCH v2 2/6] staging: vt6655: Create one function for two macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Create function vt6655_mac_set_bits with two parameters to cover
functionality of two macros.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@xxxxxxxxx>
---
V1 -> V2: Change function to cover only the set bits part and omitted
          the clear bits part
          Changed title from "...four..." to "...two..."
          Changed description accordingly
---
 drivers/staging/vt6655/device_main.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index ab6456fc2b3f..dc50bff4403f 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -216,15 +216,20 @@ static void vt6655_mac_dma_ctl(void __iomem *iobase, u8 reg_index)
 		iowrite32(DMACTL_RUN, iobase + reg_index);
 }
 
-static void MACvEnableProtectMD(void __iomem *iobase)
+static void vt6655_mac_set_bits(void __iomem *iobase, u32 mask)
 {
 	u32 reg_value;
 
 	reg_value = ioread32(iobase + MAC_REG_ENCFG);
-	reg_value = reg_value | ENCFG_PROTECTMD;
+	reg_value = reg_value | mask;
 	iowrite32(reg_value, iobase + MAC_REG_ENCFG);
 }
 
+static void MACvEnableProtectMD(void __iomem *iobase)
+{
+	vt6655_mac_set_bits(iobase, ENCFG_PROTECTMD);
+}
+
 /*
  * Initialisation of MAC & BBP registers
  */
-- 
2.37.1





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux