Commit d377df78 authored by Timur Tabi's avatar Timur Tabi Committed by David S. Miller

net: qcom/emac: fix device tree initialization

Commit "net: qcom/emac: Encapsulate sgmii ops under one structure"
introduced the sgmii_ops structure, but did not correctly initialize
it on device tree platforms.  This resulted in compiler warnings when
ACPI is not enabled.
Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarTimur Tabi <timur@codeaurora.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c3cd281e
...@@ -273,6 +273,14 @@ static int emac_sgmii_common_link_change(struct emac_adapter *adpt, bool linkup) ...@@ -273,6 +273,14 @@ static int emac_sgmii_common_link_change(struct emac_adapter *adpt, bool linkup)
return 0; return 0;
} }
static struct sgmii_ops fsm9900_ops = {
.init = emac_sgmii_init_fsm9900,
.open = emac_sgmii_common_open,
.close = emac_sgmii_common_close,
.link_change = emac_sgmii_common_link_change,
.reset = emac_sgmii_common_reset,
};
static struct sgmii_ops qdf2432_ops = { static struct sgmii_ops qdf2432_ops = {
.init = emac_sgmii_init_qdf2432, .init = emac_sgmii_init_qdf2432,
.open = emac_sgmii_common_open, .open = emac_sgmii_common_open,
...@@ -281,6 +289,7 @@ static struct sgmii_ops qdf2432_ops = { ...@@ -281,6 +289,7 @@ static struct sgmii_ops qdf2432_ops = {
.reset = emac_sgmii_common_reset, .reset = emac_sgmii_common_reset,
}; };
#ifdef CONFIG_ACPI
static struct sgmii_ops qdf2400_ops = { static struct sgmii_ops qdf2400_ops = {
.init = emac_sgmii_init_qdf2400, .init = emac_sgmii_init_qdf2400,
.open = emac_sgmii_common_open, .open = emac_sgmii_common_open,
...@@ -288,6 +297,7 @@ static struct sgmii_ops qdf2400_ops = { ...@@ -288,6 +297,7 @@ static struct sgmii_ops qdf2400_ops = {
.link_change = emac_sgmii_common_link_change, .link_change = emac_sgmii_common_link_change,
.reset = emac_sgmii_common_reset, .reset = emac_sgmii_common_reset,
}; };
#endif
static int emac_sgmii_acpi_match(struct device *dev, void *data) static int emac_sgmii_acpi_match(struct device *dev, void *data)
{ {
...@@ -335,11 +345,11 @@ static int emac_sgmii_acpi_match(struct device *dev, void *data) ...@@ -335,11 +345,11 @@ static int emac_sgmii_acpi_match(struct device *dev, void *data)
static const struct of_device_id emac_sgmii_dt_match[] = { static const struct of_device_id emac_sgmii_dt_match[] = {
{ {
.compatible = "qcom,fsm9900-emac-sgmii", .compatible = "qcom,fsm9900-emac-sgmii",
.data = emac_sgmii_init_fsm9900, .data = &fsm9900_ops,
}, },
{ {
.compatible = "qcom,qdf2432-emac-sgmii", .compatible = "qcom,qdf2432-emac-sgmii",
.data = emac_sgmii_init_qdf2432, .data = &qdf2432_ops,
}, },
{} {}
}; };
...@@ -386,7 +396,7 @@ int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt) ...@@ -386,7 +396,7 @@ int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt)
goto error_put_device; goto error_put_device;
} }
phy->sgmii_ops->init = match->data; phy->sgmii_ops = (struct sgmii_ops *)match->data;
} }
/* Base address is the first address */ /* Base address is the first address */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment