mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 12:14:01 +08:00
PCI / PM: constify pci_platform_pm_ops structure
The pci_platform_pm_ops structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
527e9316f8
commit
299f2ffed3
@ -529,7 +529,7 @@ static bool acpi_pci_need_resume(struct pci_dev *dev)
|
||||
return !!adev->power.flags.dsw_present;
|
||||
}
|
||||
|
||||
static struct pci_platform_pm_ops acpi_pci_platform_pm = {
|
||||
static const struct pci_platform_pm_ops acpi_pci_platform_pm = {
|
||||
.is_manageable = acpi_pci_power_manageable,
|
||||
.set_state = acpi_pci_set_power_state,
|
||||
.choose_state = acpi_pci_choose_state,
|
||||
|
@ -527,9 +527,9 @@ static void pci_restore_bars(struct pci_dev *dev)
|
||||
pci_update_resource(dev, i);
|
||||
}
|
||||
|
||||
static struct pci_platform_pm_ops *pci_platform_pm;
|
||||
static const struct pci_platform_pm_ops *pci_platform_pm;
|
||||
|
||||
int pci_set_platform_pm(struct pci_platform_pm_ops *ops)
|
||||
int pci_set_platform_pm(const struct pci_platform_pm_ops *ops)
|
||||
{
|
||||
if (!ops->is_manageable || !ops->set_state || !ops->choose_state
|
||||
|| !ops->sleep_wake)
|
||||
|
@ -68,7 +68,7 @@ struct pci_platform_pm_ops {
|
||||
bool (*need_resume)(struct pci_dev *dev);
|
||||
};
|
||||
|
||||
int pci_set_platform_pm(struct pci_platform_pm_ops *ops);
|
||||
int pci_set_platform_pm(const struct pci_platform_pm_ops *ops);
|
||||
void pci_update_current_state(struct pci_dev *dev, pci_power_t state);
|
||||
void pci_power_up(struct pci_dev *dev);
|
||||
void pci_disable_enabled_device(struct pci_dev *dev);
|
||||
|
Loading…
Reference in New Issue
Block a user