aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2009-04-28 05:05:21 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-28 05:05:21 -0400
commit1d58ea30b141c95bd21fb39021d4b602f48b30be (patch)
tree5140b56b65c640f1f6dfe317c8b2ec6e81aa31ce /drivers
parentbc59fcda671ee15362986a902bbd90e218fe84c4 (diff)
fs_enet: Remove dead code
CONFIG_DUET doesn't exist anymore, remove all the code that exists to support it. [ Simplify fs_init() even further -DaveM ] Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c39
-rw-r--r--drivers/net/fs_enet/fs_enet.h5
-rw-r--r--drivers/net/fs_enet/mac-fec.c34
3 files changed, 1 insertions, 77 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index 9604aaed61d6..b892c3ad9a74 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -941,30 +941,6 @@ extern void fs_mii_disconnect(struct net_device *dev);
941 941
942/**************************************************************************************/ 942/**************************************************************************************/
943 943
944/* handy pointer to the immap */
945void __iomem *fs_enet_immap = NULL;
946
947static int setup_immap(void)
948{
949#ifdef CONFIG_CPM1
950 fs_enet_immap = ioremap(IMAP_ADDR, 0x4000);
951 WARN_ON(!fs_enet_immap);
952#elif defined(CONFIG_CPM2)
953 fs_enet_immap = cpm2_immr;
954#endif
955
956 return 0;
957}
958
959static void cleanup_immap(void)
960{
961#if defined(CONFIG_CPM1)
962 iounmap(fs_enet_immap);
963#endif
964}
965
966/**************************************************************************************/
967
968#ifdef CONFIG_FS_ENET_HAS_FEC 944#ifdef CONFIG_FS_ENET_HAS_FEC
969#define IS_FEC(match) ((match)->data == &fs_fec_ops) 945#define IS_FEC(match) ((match)->data == &fs_fec_ops)
970#else 946#else
@@ -1144,25 +1120,12 @@ static struct of_platform_driver fs_enet_driver = {
1144 1120
1145static int __init fs_init(void) 1121static int __init fs_init(void)
1146{ 1122{
1147 int r = setup_immap(); 1123 return of_register_platform_driver(&fs_enet_driver);
1148 if (r != 0)
1149 return r;
1150
1151 r = of_register_platform_driver(&fs_enet_driver);
1152 if (r != 0)
1153 goto out;
1154
1155 return 0;
1156
1157out:
1158 cleanup_immap();
1159 return r;
1160} 1124}
1161 1125
1162static void __exit fs_cleanup(void) 1126static void __exit fs_cleanup(void)
1163{ 1127{
1164 of_unregister_platform_driver(&fs_enet_driver); 1128 of_unregister_platform_driver(&fs_enet_driver);
1165 cleanup_immap();
1166} 1129}
1167 1130
1168#ifdef CONFIG_NET_POLL_CONTROLLER 1131#ifdef CONFIG_NET_POLL_CONTROLLER
diff --git a/drivers/net/fs_enet/fs_enet.h b/drivers/net/fs_enet/fs_enet.h
index 85a4bab7f630..ef01e09781a5 100644
--- a/drivers/net/fs_enet/fs_enet.h
+++ b/drivers/net/fs_enet/fs_enet.h
@@ -194,9 +194,4 @@ extern const struct fs_ops fs_scc_ops;
194 194
195/*******************************************************************/ 195/*******************************************************************/
196 196
197/* handy pointer to the immap */
198extern void __iomem *fs_enet_immap;
199
200/*******************************************************************/
201
202#endif 197#endif
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index 14e575313c89..ca7bcb8ab3a1 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -245,10 +245,6 @@ static void set_multicast_list(struct net_device *dev)
245 245
246static void restart(struct net_device *dev) 246static void restart(struct net_device *dev)
247{ 247{
248#ifdef CONFIG_DUET
249 immap_t *immap = fs_enet_immap;
250 u32 cptr;
251#endif
252 struct fs_enet_private *fep = netdev_priv(dev); 248 struct fs_enet_private *fep = netdev_priv(dev);
253 fec_t __iomem *fecp = fep->fec.fecp; 249 fec_t __iomem *fecp = fep->fec.fecp;
254 const struct fs_platform_info *fpi = fep->fpi; 250 const struct fs_platform_info *fpi = fep->fpi;
@@ -315,36 +311,6 @@ static void restart(struct net_device *dev)
315 FW(fecp, ievent, 0xffc0); 311 FW(fecp, ievent, 0xffc0);
316 FW(fecp, ivec, (virq_to_hw(fep->interrupt) / 2) << 29); 312 FW(fecp, ivec, (virq_to_hw(fep->interrupt) / 2) << 29);
317 313
318 /*
319 * adjust to speed (only for DUET & RMII)
320 */
321#ifdef CONFIG_DUET
322 if (fpi->use_rmii) {
323 cptr = in_be32(&immap->im_cpm.cp_cptr);
324 switch (fs_get_fec_index(fpi->fs_no)) {
325 case 0:
326 cptr |= 0x100;
327 if (fep->speed == 10)
328 cptr |= 0x0000010;
329 else if (fep->speed == 100)
330 cptr &= ~0x0000010;
331 break;
332 case 1:
333 cptr |= 0x80;
334 if (fep->speed == 10)
335 cptr |= 0x0000008;
336 else if (fep->speed == 100)
337 cptr &= ~0x0000008;
338 break;
339 default:
340 BUG(); /* should never happen */
341 break;
342 }
343 out_be32(&immap->im_cpm.cp_cptr, cptr);
344 }
345#endif
346
347
348 FW(fecp, r_cntrl, FEC_RCNTRL_MII_MODE); /* MII enable */ 314 FW(fecp, r_cntrl, FEC_RCNTRL_MII_MODE); /* MII enable */
349 /* 315 /*
350 * adjust to duplex mode 316 * adjust to duplex mode