[PATCH 1/2] eth phy: add mdio bus char device interface

2018-06-17 Thread Wei Li
Add the char device interface of mdio bus, like what i2c-dev or spidev do. They make it possible for user-space programs to access the bus directly. Signed-off-by: Wei Li --- drivers/net/phy/Kconfig| 10 ++ drivers/net/phy/Makefile | 1 + drivers/net/phy/mdio-dev.c | 376

[PATCH 2/2] eth phy: add mdio bus char device interface

2018-06-17 Thread Wei Li
Add the notifier for the change of mdio bus, since i wanna that a char device represents a mii_bus not a mdio_device. Signed-off-by: Wei Li --- drivers/net/phy/mdio_bus.c | 21 - include/linux/mdio.h | 1 + include/linux/phy.h| 2 ++ 3 files changed, 23

[PATCH] hinic: fix potential resource leak

2020-09-16 Thread Wei Li
In rx_request_irq(), it will just return what irq_set_affinity_hint() returns. If it is failed, the napi added is not deleted properly. Add a common exit for failures to do this. Signed-off-by: Wei Li --- drivers/net/ethernet/huawei/hinic/hinic_rx.c | 19 --- 1 file changed, 12

[PATCH] net/ethernet/freescale: Fix incorrect IS_ERR_VALUE macro usages

2020-11-23 Thread Wei Li
IS_ERR_VALUE macro should be used only with unsigned long type. Especially it works incorrectly with unsigned shorter types on 64bit machines. Fixes: 4c35630ccda5 ("[POWERPC] Change rheap functions to use ulongs instead of pointers") Signed-off-by: Wei Li --- drivers/net/ethernet

[PATCH] net: fs_enet: Fix incorrect IS_ERR_VALUE macro usages

2020-11-23 Thread Wei Li
rheap functions to use ulongs instead of pointers") Signed-off-by: Wei Li --- drivers/net/ethernet/freescale/fs_enet/mac-fcc.c | 2 +- drivers/net/ethernet/freescale/fs_enet/mac-scc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/

[PATCH net v2] hinic: fix potential resource leak

2020-09-17 Thread Wei Li
In rx_request_irq(), it will just return what irq_set_affinity_hint() returns. If it is failed, the napi and irq requested are not freed properly. So add exits for failures to handle these. Signed-off-by: Wei Li --- v1 -> v2: - Free irq as well when irq_set_affinity_hint() fails. --- driv