i40e: Refactor and rename i40e_read_pba_string()
authorIvan Vecera <ivecera@redhat.com>
Fri, 13 Oct 2023 17:07:54 +0000 (19:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Oct 2023 13:33:41 +0000 (14:33 +0100)
commitdf19ea696644bea14dc2b804066a6b91aa4aaf43
treeb4b725f1a913913b1b1ec16157b4a59b686a0cb7
parent5a423552e0d9bb882f22cb0bf85f520ca2692706
i40e: Refactor and rename i40e_read_pba_string()

Function i40e_read_pba_string() is currently unused but will be used
by subsequent patch to provide board ID via devlink device info.

The function reads PBA block from NVM so it cannot be called during
adapter reset and as we would like to provide PBA ID via devlink
info it is better to read the PBA ID during i40e_probe() and cache
it in i40e_hw structure to avoid a waiting for potential adapter
reset in devlink info callback.

So...
- Remove pba_num and pba_num_size arguments from the function,
  allocate resource managed buffer to store PBA ID string and
  save resulting pointer to i40e_hw->pba_id field
- Make the function void as the PBA ID can be missing and in this
  case (or in case of NVM reading failure) the i40e_hw->pba_id
  will be NULL
- Rename the function to i40e_get_pba_string() to align with other
  functions like i40e_get_oem_version() i40e_get_port_mac_addr()...
- Call this function on init during i40e_probe()

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/i40e/i40e_common.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_prototype.h
drivers/net/ethernet/intel/i40e/i40e_type.h