aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet/mii-bitbang.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-06-12 09:32:13 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-07-16 18:57:49 -0400
commitb219108cbacee5f2eaeca63cba013688eeba3bd4 (patch)
tree656039a1d7a4db0605562c5290056a21d98865be /drivers/net/fs_enet/mii-bitbang.c
parent00262986ceeb5c3358b70491aa898906503a0fe7 (diff)
fs_enet: Remove !CONFIG_PPC_CPM_NEW_BINDING code
Now that arch/ppc is gone we always define CONFIG_PPC_CPM_NEW_BINDING so we can remove all the code associated with !CONFIG_PPC_CPM_NEW_BINDING. Also fixed some asm/of_platform.h to linux/of_platform.h (and of_device.h) Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/net/fs_enet/mii-bitbang.c')
-rw-r--r--drivers/net/fs_enet/mii-bitbang.c107
1 files changed, 0 insertions, 107 deletions
diff --git a/drivers/net/fs_enet/mii-bitbang.c b/drivers/net/fs_enet/mii-bitbang.c
index 1620030cd33c..be4b72f4f49a 100644
--- a/drivers/net/fs_enet/mii-bitbang.c
+++ b/drivers/net/fs_enet/mii-bitbang.c
@@ -22,10 +22,7 @@
22#include <linux/mii.h> 22#include <linux/mii.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/mdio-bitbang.h> 24#include <linux/mdio-bitbang.h>
25
26#ifdef CONFIG_PPC_CPM_NEW_BINDING
27#include <linux/of_platform.h> 25#include <linux/of_platform.h>
28#endif
29 26
30#include "fs_enet.h" 27#include "fs_enet.h"
31 28
@@ -110,7 +107,6 @@ static struct mdiobb_ops bb_ops = {
110 .get_mdio_data = mdio_read, 107 .get_mdio_data = mdio_read,
111}; 108};
112 109
113#ifdef CONFIG_PPC_CPM_NEW_BINDING
114static int __devinit fs_mii_bitbang_init(struct mii_bus *bus, 110static int __devinit fs_mii_bitbang_init(struct mii_bus *bus,
115 struct device_node *np) 111 struct device_node *np)
116{ 112{
@@ -271,106 +267,3 @@ static void fs_enet_mdio_bb_exit(void)
271 267
272module_init(fs_enet_mdio_bb_init); 268module_init(fs_enet_mdio_bb_init);
273module_exit(fs_enet_mdio_bb_exit); 269module_exit(fs_enet_mdio_bb_exit);
274#else
275static int __devinit fs_mii_bitbang_init(struct bb_info *bitbang,
276 struct fs_mii_bb_platform_info *fmpi)
277{
278 bitbang->dir = (u32 __iomem *)fmpi->mdio_dir.offset;
279 bitbang->dat = (u32 __iomem *)fmpi->mdio_dat.offset;
280 bitbang->mdio_msk = 1U << (31 - fmpi->mdio_dat.bit);
281 bitbang->mdc_msk = 1U << (31 - fmpi->mdc_dat.bit);
282
283 return 0;
284}
285
286static int __devinit fs_enet_mdio_probe(struct device *dev)
287{
288 struct platform_device *pdev = to_platform_device(dev);
289 struct fs_mii_bb_platform_info *pdata;
290 struct mii_bus *new_bus;
291 struct bb_info *bitbang;
292 int err = 0;
293
294 if (NULL == dev)
295 return -EINVAL;
296
297 bitbang = kzalloc(sizeof(struct bb_info), GFP_KERNEL);
298
299 if (NULL == bitbang)
300 return -ENOMEM;
301
302 bitbang->ctrl.ops = &bb_ops;
303
304 new_bus = alloc_mdio_bitbang(&bitbang->ctrl);
305
306 if (NULL == new_bus)
307 return -ENOMEM;
308
309 new_bus->name = "BB MII Bus",
310 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id);
311
312 new_bus->phy_mask = ~0x9;
313 pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data;
314
315 if (NULL == pdata) {
316 printk(KERN_ERR "gfar mdio %d: Missing platform data!\n", pdev->id);
317 return -ENODEV;
318 }
319
320 /*set up workspace*/
321 fs_mii_bitbang_init(bitbang, pdata);
322
323 new_bus->priv = bitbang;
324
325 new_bus->irq = pdata->irq;
326
327 new_bus->dev = dev;
328 dev_set_drvdata(dev, new_bus);
329
330 err = mdiobus_register(new_bus);
331
332 if (0 != err) {
333 printk (KERN_ERR "%s: Cannot register as MDIO bus\n",
334 new_bus->name);
335 goto bus_register_fail;
336 }
337
338 return 0;
339
340bus_register_fail:
341 free_mdio_bitbang(new_bus);
342 kfree(bitbang);
343
344 return err;
345}
346
347static int fs_enet_mdio_remove(struct device *dev)
348{
349 struct mii_bus *bus = dev_get_drvdata(dev);
350
351 mdiobus_unregister(bus);
352
353 dev_set_drvdata(dev, NULL);
354
355 free_mdio_bitbang(bus);
356
357 return 0;
358}
359
360static struct device_driver fs_enet_bb_mdio_driver = {
361 .name = "fsl-bb-mdio",
362 .bus = &platform_bus_type,
363 .probe = fs_enet_mdio_probe,
364 .remove = fs_enet_mdio_remove,
365};
366
367int fs_enet_mdio_bb_init(void)
368{
369 return driver_register(&fs_enet_bb_mdio_driver);
370}
371
372void fs_enet_mdio_bb_exit(void)
373{
374 driver_unregister(&fs_enet_bb_mdio_driver);
375}
376#endif