Skip to content

Commit 5f1e122

Browse files
hkallweitkuba-moo
authored andcommitted
r8169: replace BUG_ON with WARN in _rtl_eri_write
Use WARN here to avoid stopping the system. In addition print the addr and mask values that triggered the warning. v2: - return on WARN to avoid an invalid register write Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4b9c935 commit 5f1e122

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,9 @@ static void _rtl_eri_write(struct rtl8169_private *tp, int addr, u32 mask,
763763
{
764764
u32 cmd = ERIAR_WRITE_CMD | type | mask | addr;
765765

766-
BUG_ON((addr & 3) || (mask == 0));
766+
if (WARN(addr & 3 || !mask, "addr: 0x%x, mask: 0x%08x\n", addr, mask))
767+
return;
768+
767769
RTL_W32(tp, ERIDR, val);
768770
r8168fp_adjust_ocp_cmd(tp, &cmd, type);
769771
RTL_W32(tp, ERIAR, cmd);

0 commit comments

Comments
 (0)