diff options
| author | Timur Tabi <timur@codeaurora.org> | 2018-05-26 21:29:14 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-05-29 10:06:15 -0400 |
| commit | d377df784178bf5b0a39e75dc8b1ee86e1abb3f6 (patch) | |
| tree | 76f60d1648edc95ef4af47c356a6caaa60a4dba8 /drivers/net/ethernet/qualcomm/emac | |
| parent | c3cd281e2bc8da18f225f1191e9751d771411933 (diff) | |
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: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/emac')
| -rw-r--r-- | drivers/net/ethernet/qualcomm/emac/emac-sgmii.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c b/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c index 562420b834df..e78e5db39458 100644 --- a/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c +++ b/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c | |||
| @@ -273,6 +273,14 @@ static int emac_sgmii_common_link_change(struct emac_adapter *adpt, bool linkup) | |||
| 273 | return 0; | 273 | return 0; |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | static struct sgmii_ops fsm9900_ops = { | ||
| 277 | .init = emac_sgmii_init_fsm9900, | ||
| 278 | .open = emac_sgmii_common_open, | ||
| 279 | .close = emac_sgmii_common_close, | ||
| 280 | .link_change = emac_sgmii_common_link_change, | ||
| 281 | .reset = emac_sgmii_common_reset, | ||
| 282 | }; | ||
| 283 | |||
| 276 | static struct sgmii_ops qdf2432_ops = { | 284 | static struct sgmii_ops qdf2432_ops = { |
| 277 | .init = emac_sgmii_init_qdf2432, | 285 | .init = emac_sgmii_init_qdf2432, |
| 278 | .open = emac_sgmii_common_open, | 286 | .open = emac_sgmii_common_open, |
| @@ -281,6 +289,7 @@ static struct sgmii_ops qdf2432_ops = { | |||
| 281 | .reset = emac_sgmii_common_reset, | 289 | .reset = emac_sgmii_common_reset, |
| 282 | }; | 290 | }; |
| 283 | 291 | ||
| 292 | #ifdef CONFIG_ACPI | ||
| 284 | static struct sgmii_ops qdf2400_ops = { | 293 | static struct sgmii_ops qdf2400_ops = { |
| 285 | .init = emac_sgmii_init_qdf2400, | 294 | .init = emac_sgmii_init_qdf2400, |
| 286 | .open = emac_sgmii_common_open, | 295 | .open = emac_sgmii_common_open, |
| @@ -288,6 +297,7 @@ static struct sgmii_ops qdf2400_ops = { | |||
| 288 | .link_change = emac_sgmii_common_link_change, | 297 | .link_change = emac_sgmii_common_link_change, |
| 289 | .reset = emac_sgmii_common_reset, | 298 | .reset = emac_sgmii_common_reset, |
| 290 | }; | 299 | }; |
| 300 | #endif | ||
| 291 | 301 | ||
| 292 | static int emac_sgmii_acpi_match(struct device *dev, void *data) | 302 | static int emac_sgmii_acpi_match(struct device *dev, void *data) |
| 293 | { | 303 | { |
| @@ -335,11 +345,11 @@ static int emac_sgmii_acpi_match(struct device *dev, void *data) | |||
| 335 | static const struct of_device_id emac_sgmii_dt_match[] = { | 345 | static const struct of_device_id emac_sgmii_dt_match[] = { |
| 336 | { | 346 | { |
| 337 | .compatible = "qcom,fsm9900-emac-sgmii", | 347 | .compatible = "qcom,fsm9900-emac-sgmii", |
| 338 | .data = emac_sgmii_init_fsm9900, | 348 | .data = &fsm9900_ops, |
| 339 | }, | 349 | }, |
| 340 | { | 350 | { |
| 341 | .compatible = "qcom,qdf2432-emac-sgmii", | 351 | .compatible = "qcom,qdf2432-emac-sgmii", |
| 342 | .data = emac_sgmii_init_qdf2432, | 352 | .data = &qdf2432_ops, |
| 343 | }, | 353 | }, |
| 344 | {} | 354 | {} |
| 345 | }; | 355 | }; |
| @@ -386,7 +396,7 @@ int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt) | |||
| 386 | goto error_put_device; | 396 | goto error_put_device; |
| 387 | } | 397 | } |
| 388 | 398 | ||
| 389 | phy->sgmii_ops->init = match->data; | 399 | phy->sgmii_ops = (struct sgmii_ops *)match->data; |
| 390 | } | 400 | } |
| 391 | 401 | ||
| 392 | /* Base address is the first address */ | 402 | /* Base address is the first address */ |
