Skip to content

Commit d42e524

Browse files
kuba-mooPaolo Abeni
authored andcommitted
eth: fbnic: rename fbnic_fw_clear_cmpl to fbnic_mbx_clear_cmpl
fbnic_fw_clear_cmpl() does the inverse of fbnic_mbx_set_cmpl(). It removes the completion from the mailbox table. It also calls fbnic_mbx_set_cmpl_slot() internally. It should have fbnic_mbx prefix, not fbnic_fw. I'm not very clear on what the distinction is between the two prefixes but the matching "set" and "clear" functions should use the same prefix. While at it move the "clear" function closer to the "set". Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 536bc9b commit d42e524

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

drivers/net/ethernet/meta/fbnic/fbnic_devlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fbnic_flash_start(struct fbnic_dev *fbd, struct pldmfw_component *component)
182182
else
183183
err = -ETIMEDOUT;
184184

185-
fbnic_fw_clear_cmpl(fbd, cmpl);
185+
fbnic_mbx_clear_cmpl(fbd, cmpl);
186186
cmpl_free:
187187
fbnic_fw_put_cmpl(cmpl);
188188

@@ -300,7 +300,7 @@ fbnic_flash_component(struct pldmfw *context,
300300
component_name, 0, 0);
301301
}
302302

303-
fbnic_fw_clear_cmpl(fbd, cmpl);
303+
fbnic_mbx_clear_cmpl(fbd, cmpl);
304304
cmpl_free:
305305
fbnic_fw_put_cmpl(cmpl);
306306

drivers/net/ethernet/meta/fbnic/fbnic_fw.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,16 @@ static int fbnic_mbx_map_req_w_cmpl(struct fbnic_dev *fbd,
338338
return err;
339339
}
340340

341+
void fbnic_mbx_clear_cmpl(struct fbnic_dev *fbd,
342+
struct fbnic_fw_completion *fw_cmpl)
343+
{
344+
unsigned long flags;
345+
346+
spin_lock_irqsave(&fbd->fw_tx_lock, flags);
347+
fbnic_mbx_clear_cmpl_slot(fbd, fw_cmpl);
348+
spin_unlock_irqrestore(&fbd->fw_tx_lock, flags);
349+
}
350+
341351
static void fbnic_fw_release_cmpl_data(struct kref *kref)
342352
{
343353
struct fbnic_fw_completion *cmpl_data;
@@ -1263,16 +1273,6 @@ struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type)
12631273
return cmpl;
12641274
}
12651275

1266-
void fbnic_fw_clear_cmpl(struct fbnic_dev *fbd,
1267-
struct fbnic_fw_completion *fw_cmpl)
1268-
{
1269-
unsigned long flags;
1270-
1271-
spin_lock_irqsave(&fbd->fw_tx_lock, flags);
1272-
fbnic_mbx_clear_cmpl_slot(fbd, fw_cmpl);
1273-
spin_unlock_irqrestore(&fbd->fw_tx_lock, flags);
1274-
}
1275-
12761276
void fbnic_fw_put_cmpl(struct fbnic_fw_completion *fw_cmpl)
12771277
{
12781278
kref_put(&fw_cmpl->ref_count, fbnic_fw_release_cmpl_data);

drivers/net/ethernet/meta/fbnic/fbnic_fw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ void fbnic_mbx_init(struct fbnic_dev *fbd);
6666
void fbnic_mbx_clean(struct fbnic_dev *fbd);
6767
int fbnic_mbx_set_cmpl(struct fbnic_dev *fbd,
6868
struct fbnic_fw_completion *cmpl_data);
69+
void fbnic_mbx_clear_cmpl(struct fbnic_dev *fbd,
70+
struct fbnic_fw_completion *cmpl_data);
6971
void fbnic_mbx_poll(struct fbnic_dev *fbd);
7072
int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd);
7173
void fbnic_mbx_flush_tx(struct fbnic_dev *fbd);
@@ -81,8 +83,6 @@ int fbnic_fw_xmit_fw_write_chunk(struct fbnic_dev *fbd,
8183
int fbnic_fw_xmit_tsene_read_msg(struct fbnic_dev *fbd,
8284
struct fbnic_fw_completion *cmpl_data);
8385
struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type);
84-
void fbnic_fw_clear_cmpl(struct fbnic_dev *fbd,
85-
struct fbnic_fw_completion *cmpl_data);
8686
void fbnic_fw_put_cmpl(struct fbnic_fw_completion *cmpl_data);
8787

8888
#define fbnic_mk_full_fw_ver_str(_rev_id, _delim, _commit, _str, _str_sz) \

drivers/net/ethernet/meta/fbnic/fbnic_mac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ static int fbnic_mac_get_sensor_asic(struct fbnic_dev *fbd, int id,
796796

797797
*val = *sensor;
798798
exit_cleanup:
799-
fbnic_fw_clear_cmpl(fbd, fw_cmpl);
799+
fbnic_mbx_clear_cmpl(fbd, fw_cmpl);
800800
exit_free:
801801
fbnic_fw_put_cmpl(fw_cmpl);
802802

0 commit comments

Comments
 (0)