aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2008-01-31 07:10:22 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-03 07:26:00 -0500
commit06c3fd6ad546f7e6e996ca1fc2cddd9c7aee8176 (patch)
tree317f74d203f852960916734a2c25b02fcc21b843 /drivers/net/macb.c
parente87ceea13e84a0748487ed0f9ccbfbc646966339 (diff)
macb: Fix section mismatch and shrink runtime footprint
macb devices are only found integrated on SoCs, so they can't be hotplugged. Thus, the probe() and exit() functions can be __init and __exit, respectively. By using platform_driver_probe() instead of platform_driver_register(), there won't be any references to the discarded probe() function after the driver has loaded. This also fixes a section mismatch due to macb_probe(), defined as __devinit, calling macb_get_hwaddr, defined as __init. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index e10528ed9081..81bf005ff280 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1084,7 +1084,7 @@ static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1084 return phy_mii_ioctl(phydev, if_mii(rq), cmd); 1084 return phy_mii_ioctl(phydev, if_mii(rq), cmd);
1085} 1085}
1086 1086
1087static int __devinit macb_probe(struct platform_device *pdev) 1087static int __init macb_probe(struct platform_device *pdev)
1088{ 1088{
1089 struct eth_platform_data *pdata; 1089 struct eth_platform_data *pdata;
1090 struct resource *regs; 1090 struct resource *regs;
@@ -1248,7 +1248,7 @@ err_out:
1248 return err; 1248 return err;
1249} 1249}
1250 1250
1251static int __devexit macb_remove(struct platform_device *pdev) 1251static int __exit macb_remove(struct platform_device *pdev)
1252{ 1252{
1253 struct net_device *dev; 1253 struct net_device *dev;
1254 struct macb *bp; 1254 struct macb *bp;
@@ -1276,8 +1276,7 @@ static int __devexit macb_remove(struct platform_device *pdev)
1276} 1276}
1277 1277
1278static struct platform_driver macb_driver = { 1278static struct platform_driver macb_driver = {
1279 .probe = macb_probe, 1279 .remove = __exit_p(macb_remove),
1280 .remove = __devexit_p(macb_remove),
1281 .driver = { 1280 .driver = {
1282 .name = "macb", 1281 .name = "macb",
1283 }, 1282 },
@@ -1285,7 +1284,7 @@ static struct platform_driver macb_driver = {
1285 1284
1286static int __init macb_init(void) 1285static int __init macb_init(void)
1287{ 1286{
1288 return platform_driver_register(&macb_driver); 1287 return platform_driver_probe(&macb_driver, macb_probe);
1289} 1288}
1290 1289
1291static void __exit macb_exit(void) 1290static void __exit macb_exit(void)