Hi, > -----Original Message----- > From: Zhang, Tianfei <[email protected]> > Sent: Wednesday, November 25, 2020 15:19 > To: [email protected]; Xu, Rosen <[email protected]>; Zhang, Qi Z > <[email protected]> > Cc: Zhang, Tianfei <[email protected]>; [email protected] > Subject: [PATCH] raw/ifpga/base: release eth group devices > > From: Tianfei zhang <[email protected]> > > Release the eth group resource in fme_eth_group_uinit(). > > Fixes: 8a256bef32 ("raw/ifpga/base: add eth group driver") > Cc: [email protected] > > Signed-off-by: Tianfei zhang <[email protected]> > --- > drivers/raw/ifpga/base/ifpga_fme.c | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/drivers/raw/ifpga/base/ifpga_fme.c > b/drivers/raw/ifpga/base/ifpga_fme.c > index f29ff31..0a7d3c2 100644 > --- a/drivers/raw/ifpga/base/ifpga_fme.c > +++ b/drivers/raw/ifpga/base/ifpga_fme.c > @@ -1288,9 +1288,27 @@ static int fme_eth_group_init(struct ifpga_feature > *feature) > return 0; > } > > +static unsigned char fme_eth_group_get_gid(void *base) { > + struct eth_group_info_reg info; > + > + info.info = opae_readq((u8 *)base + ETH_GROUP_INFO); > + > + return info.group_id; > +} > + > static void fme_eth_group_uinit(struct ifpga_feature *feature) { > - UNUSED(feature); > + struct ifpga_fme_hw *fme = (struct ifpga_fme_hw *)feature->parent; > + struct eth_group_device *dev; > + unsigned char group_id = fme_eth_group_get_gid(feature->addr); > + > + if (group_id >= MAX_ETH_GROUP_DEVICES) > + return; > + > + dev = fme->eth_dev[group_id]; > + if (dev) > + eth_group_release(dev); > } > > struct ifpga_feature_ops fme_eth_group_ops = { > -- > 1.8.3.1
Reviewed-by: Rosen Xu <[email protected]>

