Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michal Swiatkowski and committed by
Tony Nguyen
4b5f288a 02f44dac

+11 -2
+10 -1
drivers/net/ethernet/intel/ice/ice_fwlog.c
··· 290 290 * After this call the PF will start to receive firmware logging based on the 291 291 * configuration set in libie_fwlog_set. 292 292 */ 293 - int libie_fwlog_register(struct libie_fwlog *fwlog) 293 + static int libie_fwlog_register(struct libie_fwlog *fwlog) 294 294 { 295 295 int status; 296 296 ··· 1094 1094 /* the rings are full so bump the head to create room */ 1095 1095 libie_fwlog_ring_increment(&fwlog->ring.head, fwlog->ring.size); 1096 1096 } 1097 + } 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; 1097 1106 }
+1 -1
drivers/net/ethernet/intel/ice/ice_fwlog.h
··· 79 79 80 80 int libie_fwlog_init(struct libie_fwlog *fwlog, struct libie_fwlog_api *api); 81 81 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); 83 83 void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, u16 len); 84 84 #endif /* _LIBIE_FWLOG_H_ */