diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-11-07 09:46:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-07 12:25:23 -0500 |
commit | f10f9fb2167bfb5f02a63eb320813ff3c71eec98 (patch) | |
tree | 4decc8a43a7786c3178beadb2bba69896d146c64 /drivers/net/ethernet/stmicro | |
parent | 424c4f7875ee21e803f6ebeb8799b6185eda7864 (diff) |
stmmac: platform: fix sparse warnings
This patch fixes the following sparse warnings. One is fixed by casting return
value to a return type of the function. The others by creating a specific
stmmac_platform.h which provides the bits related to the platform driver.
drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c:59:29: warning: incorrect type in return expression (different address spaces)
drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c:59:29: expected void *
drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c:59:29: got void [noderef] <asn:2>*reg
drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c:64:29: warning: symbol 'meson6_dwmac_data' was not declared. Should it be static?
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c:354:29: warning: symbol 'stih4xx_dwmac_data' was not declared. Should it be static?
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c:361:29: warning: symbol 'stid127_dwmac_data' was not declared. Should it be static?
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c:133:29: warning: symbol 'sun7i_gmac_data' was not declared. Should it be static?
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro')
7 files changed, 39 insertions, 6 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c index d225a603e604..cca028d632f6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/stmmac.h> | 19 | #include <linux/stmmac.h> |
20 | 20 | ||
21 | #include "stmmac_platform.h" | ||
22 | |||
21 | #define ETHMAC_SPEED_100 BIT(1) | 23 | #define ETHMAC_SPEED_100 BIT(1) |
22 | 24 | ||
23 | struct meson_dwmac { | 25 | struct meson_dwmac { |
@@ -56,7 +58,7 @@ static void *meson6_dwmac_setup(struct platform_device *pdev) | |||
56 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 58 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
57 | dwmac->reg = devm_ioremap_resource(&pdev->dev, res); | 59 | dwmac->reg = devm_ioremap_resource(&pdev->dev, res); |
58 | if (IS_ERR(dwmac->reg)) | 60 | if (IS_ERR(dwmac->reg)) |
59 | return dwmac->reg; | 61 | return ERR_CAST(dwmac->reg); |
60 | 62 | ||
61 | return dwmac; | 63 | return dwmac; |
62 | } | 64 | } |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 3aad413e74b4..e97074cd5800 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | |||
@@ -23,7 +23,9 @@ | |||
23 | #include <linux/regmap.h> | 23 | #include <linux/regmap.h> |
24 | #include <linux/reset.h> | 24 | #include <linux/reset.h> |
25 | #include <linux/stmmac.h> | 25 | #include <linux/stmmac.h> |
26 | |||
26 | #include "stmmac.h" | 27 | #include "stmmac.h" |
28 | #include "stmmac_platform.h" | ||
27 | 29 | ||
28 | #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII 0x0 | 30 | #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII 0x0 |
29 | #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII 0x1 | 31 | #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII 0x1 |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c index ccfe7e510418..ea4069276444 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | |||
@@ -22,6 +22,8 @@ | |||
22 | #include <linux/of.h> | 22 | #include <linux/of.h> |
23 | #include <linux/of_net.h> | 23 | #include <linux/of_net.h> |
24 | 24 | ||
25 | #include "stmmac_platform.h" | ||
26 | |||
25 | #define DWMAC_125MHZ 125000000 | 27 | #define DWMAC_125MHZ 125000000 |
26 | #define DWMAC_50MHZ 50000000 | 28 | #define DWMAC_50MHZ 50000000 |
27 | #define DWMAC_25MHZ 25000000 | 29 | #define DWMAC_25MHZ 25000000 |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c index 771cd15fca18..a26bda274c66 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | |||
@@ -22,6 +22,8 @@ | |||
22 | #include <linux/of_net.h> | 22 | #include <linux/of_net.h> |
23 | #include <linux/regulator/consumer.h> | 23 | #include <linux/regulator/consumer.h> |
24 | 24 | ||
25 | #include "stmmac_platform.h" | ||
26 | |||
25 | struct sunxi_priv_data { | 27 | struct sunxi_priv_data { |
26 | int interface; | 28 | int interface; |
27 | int clk_enabled; | 29 | int clk_enabled; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 709798b6aec3..bd75ee8b2757 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h | |||
@@ -135,11 +135,6 @@ void stmmac_disable_eee_mode(struct stmmac_priv *priv); | |||
135 | bool stmmac_eee_init(struct stmmac_priv *priv); | 135 | bool stmmac_eee_init(struct stmmac_priv *priv); |
136 | 136 | ||
137 | #ifdef CONFIG_STMMAC_PLATFORM | 137 | #ifdef CONFIG_STMMAC_PLATFORM |
138 | extern const struct stmmac_of_data meson6_dwmac_data; | ||
139 | extern const struct stmmac_of_data sun7i_gmac_data; | ||
140 | extern const struct stmmac_of_data stih4xx_dwmac_data; | ||
141 | extern const struct stmmac_of_data stid127_dwmac_data; | ||
142 | extern const struct stmmac_of_data socfpga_gmac_data; | ||
143 | extern struct platform_driver stmmac_pltfr_driver; | 138 | extern struct platform_driver stmmac_pltfr_driver; |
144 | 139 | ||
145 | static inline int stmmac_register_platform(void) | 140 | static inline int stmmac_register_platform(void) |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index f4fe854f3ee3..9f18401022e1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -27,7 +27,9 @@ | |||
27 | #include <linux/of.h> | 27 | #include <linux/of.h> |
28 | #include <linux/of_net.h> | 28 | #include <linux/of_net.h> |
29 | #include <linux/of_device.h> | 29 | #include <linux/of_device.h> |
30 | |||
30 | #include "stmmac.h" | 31 | #include "stmmac.h" |
32 | #include "stmmac_platform.h" | ||
31 | 33 | ||
32 | static const struct of_device_id stmmac_dt_ids[] = { | 34 | static const struct of_device_id stmmac_dt_ids[] = { |
33 | /* SoC specific glue layers should come before generic bindings */ | 35 | /* SoC specific glue layers should come before generic bindings */ |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h new file mode 100644 index 000000000000..25dd1f7ace02 --- /dev/null +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /******************************************************************************* | ||
2 | Copyright (C) 2007-2009 STMicroelectronics Ltd | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify it | ||
5 | under the terms and conditions of the GNU General Public License, | ||
6 | version 2, as published by the Free Software Foundation. | ||
7 | |||
8 | This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | more details. | ||
12 | |||
13 | The full GNU General Public License is included in this distribution in | ||
14 | the file called "COPYING". | ||
15 | |||
16 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | ||
17 | *******************************************************************************/ | ||
18 | |||
19 | #ifndef __STMMAC_PLATFORM_H__ | ||
20 | #define __STMMAC_PLATFORM_H__ | ||
21 | |||
22 | extern const struct stmmac_of_data meson6_dwmac_data; | ||
23 | extern const struct stmmac_of_data sun7i_gmac_data; | ||
24 | extern const struct stmmac_of_data stih4xx_dwmac_data; | ||
25 | extern const struct stmmac_of_data stid127_dwmac_data; | ||
26 | extern const struct stmmac_of_data socfpga_gmac_data; | ||
27 | |||
28 | #endif /* __STMMAC_PLATFORM_H__ */ | ||