Commit 4b5f288a authored by Michal Swiatkowski's avatar Michal Swiatkowski Committed by Tony Nguyen
Browse files

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: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 02f44dac
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@ static int libie_aq_fwlog_register(struct libie_fwlog *fwlog, bool reg)
 * After this call the PF will start to receive firmware logging based on the
 * configuration set in libie_fwlog_set.
 */
int libie_fwlog_register(struct libie_fwlog *fwlog)
static int libie_fwlog_register(struct libie_fwlog *fwlog)
{
	int status;

@@ -1095,3 +1095,12 @@ void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, u16 len)
		libie_fwlog_ring_increment(&fwlog->ring.head, fwlog->ring.size);
	}
}

void libie_fwlog_reregister(struct libie_fwlog *fwlog)
{
	if (!(fwlog->cfg.options & LIBIE_FWLOG_OPTION_IS_REGISTERED))
		return;

	if (libie_fwlog_register(fwlog))
		fwlog->cfg.options &= ~LIBIE_FWLOG_OPTION_IS_REGISTERED;
}
+1 −1
Original line number Diff line number Diff line
@@ -79,6 +79,6 @@ struct libie_fwlog {

int libie_fwlog_init(struct libie_fwlog *fwlog, struct libie_fwlog_api *api);
void libie_fwlog_deinit(struct libie_fwlog *fwlog);
int libie_fwlog_register(struct libie_fwlog *fwlog);
void libie_fwlog_reregister(struct libie_fwlog *fwlog);
void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, u16 len);
#endif /* _LIBIE_FWLOG_H_ */