Skip to contentSkip to conversation

net: usb: sr9700: rename register write commands for clarity

PATCH Applied Ethan Nelson-Moore 4 participants 4 messages Jan 23 – Jan 25

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

PATCH 1/1 net: usb: sr9700: rename register write commands for clarity

SR_WR_REG and SR_WR_REGS may be confused at a cursory glance. Rename them to be more easily differentiated to prevent this.

---
 drivers/net/usb/sr9700.c | 8 ++++----
 drivers/net/usb/sr9700.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/usb/sr9700.c +4 -4
index 9c7cd0db1768..e518e1710b18 100644
@@ -37,7 +37,7 @@ static int sr_write(struct usbnet *dev, u8 reg, u16 length, void *data)
 {
 	int err;
 
-	err = usbnet_write_cmd(dev, SR_WR_REGS, SR_REQ_WR_REG, 0, reg, data,
+	err = usbnet_write_cmd(dev, SR_WR_MULTIPLE_REGS, SR_REQ_WR_REG, 0, reg, data,
 			       length);
 	if ((err >= 0) && (err < length))
 		err = -EINVAL;
@@ -51,20 +51,20 @@ static int sr_read_reg(struct usbnet *dev, u8 reg, u8 *value)
 
 static int sr_write_reg(struct usbnet *dev, u8 reg, u8 value)
 {
-	return usbnet_write_cmd(dev, SR_WR_REG, SR_REQ_WR_REG,
+	return usbnet_write_cmd(dev, SR_WR_SINGLE_REG, SR_REQ_WR_REG,
 				value, reg, NULL, 0);
 }
 
 static void sr_write_async(struct usbnet *dev, u8 reg, u16 length,
 			   const void *data)
 {
-	usbnet_write_cmd_async(dev, SR_WR_REGS, SR_REQ_WR_REG,
+	usbnet_write_cmd_async(dev, SR_WR_MULTIPLE_REGS, SR_REQ_WR_REG,
 			       0, reg, data, length);
 }
 
 static void sr_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
 {
-	usbnet_write_cmd_async(dev, SR_WR_REG, SR_REQ_WR_REG,
+	usbnet_write_cmd_async(dev, SR_WR_SINGLE_REG, SR_REQ_WR_REG,
 			       value, reg, NULL, 0);
 }
 
drivers/net/usb/sr9700.h +2 -2
index 3212859830dc..5c04ea0306c7 100644
@@ -150,8 +150,8 @@
 
 /* Register access commands and flags */
 #define	SR_RD_REGS		0x00
-#define	SR_WR_REGS		0x01
-#define	SR_WR_REG		0x03
+#define	SR_WR_MULTIPLE_REGS	0x01
+#define	SR_WR_SINGLE_REG	0x03
 #define	SR_REQ_RD_REG	(USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE)
 #define	SR_REQ_WR_REG	(USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE)
 
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ethan Nelson-Moore
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ethan" == Ethan Nelson-Moore <[email protected]> writes:

SR_WR_REG and SR_WR_REGS may be confused at a cursory glance. Rename them to be more easily differentiated to prevent this.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw
In reply to Ethan Nelson-Moore
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Fri, 23 Jan 2026 00:03:58 -0800 you wrote:

SR_WR_REG and SR_WR_REGS may be confused at a cursory glance. Rename them to be more easily differentiated to prevent this.

---
 drivers/net/usb/sr9700.c | 8 ++++----
 drivers/net/usb/sr9700.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

Here is the summary with links:
- [net-next] net: usb: sr9700: rename register write commands for clarity

    https://git.kernel.org/netdev/net-next/c/4a7bbaa663f5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html