Skip to content

Commit 0c07802

Browse files
namiltdPaolo Abeni
authored andcommitted
net: dsa: realtek: rtl8365mb: fix mode mask calculation
The RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_MASK macro was shifting the 4-bit mask (0xF) by only (_extint % 2) bits instead of (_extint % 2) * 4. This caused the mask to overlap with the adjacent nibble when configuring odd-numbered external interfaces, selecting the wrong bits entirely. Align the shift calculation with the existing ...MODE_OFFSET macro. Fixes: 4af2950 ("net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC") Signed-off-by: Abdulkader Alrezej <alrazj.abdulkader@gmail.com> Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Link: https://patch.msgid.link/400a6387-a444-4576-af6d-26be5410bce3@yahoo.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 084a39a commit 0c07802

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/dsa/realtek/rtl8365mb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
(_extint) == 2 ? RTL8365MB_DIGITAL_INTERFACE_SELECT_REG1 : \
217217
0x0)
218218
#define RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_MASK(_extint) \
219-
(0xF << (((_extint) % 2)))
219+
(0xF << (((_extint) % 2) * 4))
220220
#define RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_OFFSET(_extint) \
221221
(((_extint) % 2) * 4)
222222

0 commit comments

Comments
 (0)