Skip to contentSkip to conversation

qcom-emag: hide ACPI specific functions

PATCH In review Arnd Bergmann 2 participants 3 messages May 25, 2018 – May 27, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qcom-emag: hide ACPI specific functions

A couple of functions in this file are only used when building with ACPI enabled, leading to a build warning on most architectures:

drivers/net/ethernet/qualcomm/emac/emac-sgmii.c:284:25: error: 'qdf2400_ops' defined but not used [-Werror=unused-variable]

 static struct sgmii_ops qdf2400_ops = {
                         ^~~~~~~~~~~

drivers/net/ethernet/qualcomm/emac/emac-sgmii.c:276:25: error: 'qdf2432_ops' defined but not used [-Werror=unused-variable]
static struct sgmii_ops qdf2432_ops = {

This hides all the unused functions by putting them into the corresponding #ifdef.

---
 drivers/net/ethernet/qualcomm/emac/emac-sgmii.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/qualcomm/emac/emac-sgmii.c +2 -0
index 562420b834df..01b80e0a5367 100644
@@ -108,6 +108,7 @@ static void emac_sgmii_link_init(struct emac_adapter *adpt)
 	writel(val, phy->base + EMAC_SGMII_PHY_AUTONEG_CFG2);
 }
 
+#ifdef CONFIG_ACPI
 static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u8 irq_bits)
 {
 	struct emac_sgmii *phy = &adpt->phy;
@@ -288,6 +289,7 @@ static struct sgmii_ops qdf2400_ops = {
 	.link_change = emac_sgmii_common_link_change,
 	.reset = emac_sgmii_common_reset,
 };
+#endif
 
 static int emac_sgmii_acpi_match(struct device *dev, void *data)
 {
Signature · 1 line
2.9.0
#1 lore raw

drivers/net/ethernet/qualcomm/emac/emac-sgmii.c static struct sgmii_ops qdf2400_ops = { · line 292

Quoted 9 lines · Arnd Bergmann
drivers/net/ethernet/qualcomm/emac/emac-sgmii.c +2 -0
+#ifdef CONFIG_ACPI
  static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u8 irq_bits)
  {
  	struct emac_sgmii *phy = &adpt->phy;
@@ -288,6 +289,7 @@ static struct sgmii_ops qdf2400_ops = {
  	.link_change = emac_sgmii_common_link_change,
  	.reset = emac_sgmii_common_reset,
  };
+#endif

This seems wrong. The SGMII interrupt handler should still be viable on a device-tree system. There is a DT compatibility entry for the qdf2432.

Looks like that most recent patch on net-next broke DT support, when it removed these lines:

- phy->open = emac_sgmii_open;
- phy->close = emac_sgmii_close;
- phy->link_up = emac_sgmii_link_up;
- phy->link_down = emac_sgmii_link_down;

I'll take it look at it next week when I'm back in the office.

Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#2 lore raw
Quoted 6 lines · Timur Tabi

-    phy->open = emac_sgmii_open;
-    phy->close = emac_sgmii_close;
-    phy->link_up = emac_sgmii_link_up;
-    phy->link_down = emac_sgmii_link_down;

I'll take it look at it next week when I'm back in the office.

I posted a patch that fixes this problem and also retains device-tree support.

Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.