Re: [PATCH v4 07/14] net-next/yunsilicon: Init auxiliary device
From: tianx <hidden>
Date: 2025-02-17 02:17:34
On 2025/2/16 17:59, Leon Romanovsky wrote:
On Fri, Feb 14, 2025 at 11:14:45AM +0800, tianx wrote:quoted
On 2025/2/13 22:37, Leon Romanovsky wrote:quoted
On Thu, Feb 13, 2025 at 05:14:19PM +0800, Xin Tian wrote:quoted
Initialize eth auxiliary device when pci probing Co-developed-by: Honggang Wei <redacted> Signed-off-by: Honggang Wei <redacted> Co-developed-by: Lei Yan <redacted> Signed-off-by: Lei Yan <redacted> Signed-off-by: Xin Tian <redacted> --- .../ethernet/yunsilicon/xsc/common/xsc_core.h | 12 ++ .../net/ethernet/yunsilicon/xsc/pci/Makefile | 3 +- .../net/ethernet/yunsilicon/xsc/pci/adev.c | 110 ++++++++++++++++++ .../net/ethernet/yunsilicon/xsc/pci/adev.h | 14 +++ .../net/ethernet/yunsilicon/xsc/pci/main.c | 10 ++ 5 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/adev.c create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/adev.h<...><...>quoted
quoted
quoted
+ [XSC_ADEV_IDX_ETH] = XSC_ETH_ADEV_NAME, +}; + +static void xsc_release_adev(struct device *dev) +{ + /* Doing nothing, but auxiliary bus requires a release function */ +}It is unlikely to be true in driver lifetime model. At least you should free xsc_adev here. ThanksHi Leon, xsc_adev has already been freed after calling auxiliary_device_uninit. If I free it again in the release callback, it will cause a double free.You should follow standard driver lifetime model. Your auxiliary_device_uninit() is wrong and shouldn't exist from the beginning. Thanks
OK, I'll change it. Thanks for reviewing.