mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
cxgb3: Use VPD API in t3_seeprom_wp()
Use standard VPD API to replace t3_seeprom_write(), this prepares for removing this function. Chelsio T3 maps the EEPROM write protect flag to an arbitrary place in VPD address space, therefore we have to use pci_write_vpd_any(). Link: https://lore.kernel.org/r/f768fdbe-3a16-d539-57d2-c7c908294336@gmail.com Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
48225f1878
commit
43f3b61e37
1 changed files with 8 additions and 1 deletions
|
@ -642,7 +642,14 @@ int t3_seeprom_write(struct adapter *adapter, u32 addr, __le32 data)
|
|||
*/
|
||||
int t3_seeprom_wp(struct adapter *adapter, int enable)
|
||||
{
|
||||
return t3_seeprom_write(adapter, EEPROM_STAT_ADDR, enable ? 0xc : 0);
|
||||
u32 data = enable ? 0xc : 0;
|
||||
int ret;
|
||||
|
||||
/* EEPROM_STAT_ADDR is outside VPD area, use pci_write_vpd_any() */
|
||||
ret = pci_write_vpd_any(adapter->pdev, EEPROM_STAT_ADDR, sizeof(u32),
|
||||
&data);
|
||||
|
||||
return ret < 0 ? ret : 0;
|
||||
}
|
||||
|
||||
static int vpdstrtouint(char *s, u8 len, unsigned int base, unsigned int *val)
|
||||
|
|
Loading…
Reference in a new issue