Skip to content

Commit

Permalink
net: atlantic: Define aq_pm_ops conditionally on CONFIG_PM
Browse files Browse the repository at this point in the history
For s390, gcc with W=1 reports
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c:458:32: error:
  'aq_pm_ops' defined but not used [-Werror=unused-const-variable=]
  458 | static const struct dev_pm_ops aq_pm_ops = {
      |                                ^~~~~~~~~

The only use of aq_pm_ops is conditional on CONFIG_PM.
The definition of aq_pm_ops and its functions should also
be conditional on CONFIG_PM.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tom Rix authored and David S. Miller committed May 1, 2023
1 parent 281900a commit 4f163bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ static void aq_pci_shutdown(struct pci_dev *pdev)
}
}

#ifdef CONFIG_PM
static int aq_suspend_common(struct device *dev)
{
struct aq_nic_s *nic = pci_get_drvdata(to_pci_dev(dev));
Expand Down Expand Up @@ -463,6 +464,7 @@ static const struct dev_pm_ops aq_pm_ops = {
.restore = aq_pm_resume_restore,
.thaw = aq_pm_thaw,
};
#endif

static struct pci_driver aq_pci_ops = {
.name = AQ_CFG_DRV_NAME,
Expand Down

0 comments on commit 4f163bf

Please sign in to comment.