123123#include <linux/io.h>
124124#include <linux/of.h>
125125#include <linux/of_net.h>
126- #include <linux/of_address.h>
127126#include <linux/of_platform.h>
128- #include <linux/of_device.h>
129127#include <linux/clk.h>
130128#include <linux/property.h>
131129#include <linux/acpi.h>
135133#include "xgbe-common.h"
136134
137135#ifdef CONFIG_ACPI
138- static const struct acpi_device_id xgbe_acpi_match [];
139-
140- static struct xgbe_version_data * xgbe_acpi_vdata (struct xgbe_prv_data * pdata )
141- {
142- const struct acpi_device_id * id ;
143-
144- id = acpi_match_device (xgbe_acpi_match , pdata -> dev );
145-
146- return id ? (struct xgbe_version_data * )id -> driver_data : NULL ;
147- }
148-
149136static int xgbe_acpi_support (struct xgbe_prv_data * pdata )
150137{
151138 struct device * dev = pdata -> dev ;
@@ -173,29 +160,13 @@ static int xgbe_acpi_support(struct xgbe_prv_data *pdata)
173160 return 0 ;
174161}
175162#else /* CONFIG_ACPI */
176- static struct xgbe_version_data * xgbe_acpi_vdata (struct xgbe_prv_data * pdata )
177- {
178- return NULL ;
179- }
180-
181163static int xgbe_acpi_support (struct xgbe_prv_data * pdata )
182164{
183165 return - EINVAL ;
184166}
185167#endif /* CONFIG_ACPI */
186168
187169#ifdef CONFIG_OF
188- static const struct of_device_id xgbe_of_match [];
189-
190- static struct xgbe_version_data * xgbe_of_vdata (struct xgbe_prv_data * pdata )
191- {
192- const struct of_device_id * id ;
193-
194- id = of_match_device (xgbe_of_match , pdata -> dev );
195-
196- return id ? (struct xgbe_version_data * )id -> data : NULL ;
197- }
198-
199170static int xgbe_of_support (struct xgbe_prv_data * pdata )
200171{
201172 struct device * dev = pdata -> dev ;
@@ -244,11 +215,6 @@ static struct platform_device *xgbe_of_get_phy_pdev(struct xgbe_prv_data *pdata)
244215 return phy_pdev ;
245216}
246217#else /* CONFIG_OF */
247- static struct xgbe_version_data * xgbe_of_vdata (struct xgbe_prv_data * pdata )
248- {
249- return NULL ;
250- }
251-
252218static int xgbe_of_support (struct xgbe_prv_data * pdata )
253219{
254220 return - EINVAL ;
@@ -290,12 +256,6 @@ static struct platform_device *xgbe_get_phy_pdev(struct xgbe_prv_data *pdata)
290256 return phy_pdev ;
291257}
292258
293- static struct xgbe_version_data * xgbe_get_vdata (struct xgbe_prv_data * pdata )
294- {
295- return pdata -> use_acpi ? xgbe_acpi_vdata (pdata )
296- : xgbe_of_vdata (pdata );
297- }
298-
299259static int xgbe_platform_probe (struct platform_device * pdev )
300260{
301261 struct xgbe_prv_data * pdata ;
@@ -321,7 +281,7 @@ static int xgbe_platform_probe(struct platform_device *pdev)
321281 pdata -> use_acpi = dev -> of_node ? 0 : 1 ;
322282
323283 /* Get the version data */
324- pdata -> vdata = xgbe_get_vdata ( pdata );
284+ pdata -> vdata = ( struct xgbe_version_data * ) device_get_match_data ( dev );
325285
326286 phy_pdev = xgbe_get_phy_pdev (pdata );
327287 if (!phy_pdev ) {
0 commit comments