Skip to content

Commit e8562da

Browse files
emuslnjgunthorpe
authored andcommitted
pds_core: make pdsc_auxbus_dev_del() void
Since there really is no useful return, advertising a return value is rather misleading. Make pdsc_auxbus_dev_del() a void function. Link: https://patch.msgid.link/r/[email protected] Reviewed-by: Leon Romanovsky <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 0e18a6e commit e8562da

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

drivers/net/ethernet/amd/pds_core/auxbus.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,9 @@ static struct pds_auxiliary_dev *pdsc_auxbus_dev_register(struct pdsc *cf,
175175
return padev;
176176
}
177177

178-
int pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf)
178+
void pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf)
179179
{
180180
struct pds_auxiliary_dev *padev;
181-
int err = 0;
182-
183-
if (!cf)
184-
return -ENODEV;
185181

186182
mutex_lock(&pf->config_lock);
187183

@@ -195,7 +191,6 @@ int pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf)
195191
pf->vfs[cf->vf_id].padev = NULL;
196192

197193
mutex_unlock(&pf->config_lock);
198-
return err;
199194
}
200195

201196
int pdsc_auxbus_dev_add(struct pdsc *cf, struct pdsc *pf)

drivers/net/ethernet/amd/pds_core/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ int pdsc_register_notify(struct notifier_block *nb);
304304
void pdsc_unregister_notify(struct notifier_block *nb);
305305
void pdsc_notify(unsigned long event, void *data);
306306
int pdsc_auxbus_dev_add(struct pdsc *cf, struct pdsc *pf);
307-
int pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf);
307+
void pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf);
308308

309309
void pdsc_process_adminq(struct pdsc_qcq *qcq);
310310
void pdsc_work_thread(struct work_struct *work);

drivers/net/ethernet/amd/pds_core/devlink.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ int pdsc_dl_enable_set(struct devlink *dl, u32 id,
5656
for (vf_id = 0; vf_id < pdsc->num_vfs; vf_id++) {
5757
struct pdsc *vf = pdsc->vfs[vf_id].vf;
5858

59-
err = ctx->val.vbool ? pdsc_auxbus_dev_add(vf, pdsc) :
60-
pdsc_auxbus_dev_del(vf, pdsc);
59+
if (ctx->val.vbool)
60+
err = pdsc_auxbus_dev_add(vf, pdsc);
61+
else
62+
pdsc_auxbus_dev_del(vf, pdsc);
6163
}
6264

6365
return err;

0 commit comments

Comments
 (0)