LinuxKPI: pci.h make pci_dev argument const for pci_{read,write}_config*()

Make the struct pci_dev argument to the pci_{read,write}_config*()
functions "const" to match the Linux definition as some drivers
try to pass in a const argument which we currently fail to honor.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ed5600f532)
This commit is contained in:
Bjoern A. Zeeb 2021-10-25 17:06:09 +00:00
parent dc70c937b1
commit c7fc9ca779

View file

@ -696,7 +696,7 @@ pci_disable_link_state(struct pci_dev *pdev, uint32_t flags)
}
static inline int
pci_read_config_byte(struct pci_dev *pdev, int where, u8 *val)
pci_read_config_byte(const struct pci_dev *pdev, int where, u8 *val)
{
*val = (u8)pci_read_config(pdev->dev.bsddev, where, 1);
@ -704,7 +704,7 @@ pci_read_config_byte(struct pci_dev *pdev, int where, u8 *val)
}
static inline int
pci_read_config_word(struct pci_dev *pdev, int where, u16 *val)
pci_read_config_word(const struct pci_dev *pdev, int where, u16 *val)
{
*val = (u16)pci_read_config(pdev->dev.bsddev, where, 2);
@ -712,7 +712,7 @@ pci_read_config_word(struct pci_dev *pdev, int where, u16 *val)
}
static inline int
pci_read_config_dword(struct pci_dev *pdev, int where, u32 *val)
pci_read_config_dword(const struct pci_dev *pdev, int where, u32 *val)
{
*val = (u32)pci_read_config(pdev->dev.bsddev, where, 4);
@ -720,7 +720,7 @@ pci_read_config_dword(struct pci_dev *pdev, int where, u32 *val)
}
static inline int
pci_write_config_byte(struct pci_dev *pdev, int where, u8 val)
pci_write_config_byte(const struct pci_dev *pdev, int where, u8 val)
{
pci_write_config(pdev->dev.bsddev, where, val, 1);
@ -728,7 +728,7 @@ pci_write_config_byte(struct pci_dev *pdev, int where, u8 val)
}
static inline int
pci_write_config_word(struct pci_dev *pdev, int where, u16 val)
pci_write_config_word(const struct pci_dev *pdev, int where, u16 val)
{
pci_write_config(pdev->dev.bsddev, where, val, 2);
@ -736,7 +736,7 @@ pci_write_config_word(struct pci_dev *pdev, int where, u16 val)
}
static inline int
pci_write_config_dword(struct pci_dev *pdev, int where, u32 val)
pci_write_config_dword(const struct pci_dev *pdev, int where, u32 val)
{
pci_write_config(pdev->dev.bsddev, where, val, 4);