devlink: Replace devlink_port_attrs_set parameters with a struct
Currently, devlink_port_attrs_set accepts a long list of parameters, that most of them are devlink port's attributes. Use the devlink_port_attrs struct to replace the relevant parameters. Signed-off-by: Danielle Ratson <danieller@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
46737a1949
commit
71ad8d55f8
@@ -691,6 +691,7 @@ static void bnxt_dl_params_unregister(struct bnxt *bp)
|
||||
|
||||
int bnxt_dl_register(struct bnxt *bp)
|
||||
{
|
||||
struct devlink_port_attrs attrs = {};
|
||||
struct devlink *dl;
|
||||
int rc;
|
||||
|
||||
@@ -719,9 +720,11 @@ int bnxt_dl_register(struct bnxt *bp)
|
||||
if (!BNXT_PF(bp))
|
||||
return 0;
|
||||
|
||||
devlink_port_attrs_set(&bp->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
|
||||
bp->pf.port_id, false, 0, bp->dsn,
|
||||
sizeof(bp->dsn));
|
||||
attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
|
||||
attrs.phys.port_number = bp->pf.port_id;
|
||||
memcpy(attrs.switch_id.id, bp->dsn, sizeof(bp->dsn));
|
||||
attrs.switch_id.id_len = sizeof(bp->dsn);
|
||||
devlink_port_attrs_set(&bp->dl_port, &attrs);
|
||||
rc = devlink_port_register(dl, &bp->dl_port, bp->pf.port_id);
|
||||
if (rc) {
|
||||
netdev_err(bp->dev, "devlink_port_register failed\n");
|
||||
|
Reference in New Issue
Block a user