Skip to content

Commit 4b5f288

Browse files
Michal Swiatkowskianguy11
authored andcommitted
ice: reregister fwlog after driver reinit
Wrap libie_fwlog_register() by libie_fwlog_reregister(), which checks first if the registration is needed. This simplifies the code and makes the former function static. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel) Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 02f44da commit 4b5f288

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

drivers/net/ethernet/intel/ice/ice_fwlog.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static int libie_aq_fwlog_register(struct libie_fwlog *fwlog, bool reg)
290290
* After this call the PF will start to receive firmware logging based on the
291291
* configuration set in libie_fwlog_set.
292292
*/
293-
int libie_fwlog_register(struct libie_fwlog *fwlog)
293+
static int libie_fwlog_register(struct libie_fwlog *fwlog)
294294
{
295295
int status;
296296

@@ -1095,3 +1095,12 @@ void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, u16 len)
10951095
libie_fwlog_ring_increment(&fwlog->ring.head, fwlog->ring.size);
10961096
}
10971097
}
1098+
1099+
void libie_fwlog_reregister(struct libie_fwlog *fwlog)
1100+
{
1101+
if (!(fwlog->cfg.options & LIBIE_FWLOG_OPTION_IS_REGISTERED))
1102+
return;
1103+
1104+
if (libie_fwlog_register(fwlog))
1105+
fwlog->cfg.options &= ~LIBIE_FWLOG_OPTION_IS_REGISTERED;
1106+
}

drivers/net/ethernet/intel/ice/ice_fwlog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ struct libie_fwlog {
7979

8080
int libie_fwlog_init(struct libie_fwlog *fwlog, struct libie_fwlog_api *api);
8181
void libie_fwlog_deinit(struct libie_fwlog *fwlog);
82-
int libie_fwlog_register(struct libie_fwlog *fwlog);
82+
void libie_fwlog_reregister(struct libie_fwlog *fwlog);
8383
void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, u16 len);
8484
#endif /* _LIBIE_FWLOG_H_ */

0 commit comments

Comments
 (0)