Skip to content

Commit

Permalink
macb: Fix section mismatch and shrink runtime footprint
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Haavard Skinnemoen authored and David S. Miller committed Feb 3, 2008
1 parent e87ceea commit 06c3fd6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/net/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return phy_mii_ioctl(phydev, if_mii(rq), cmd);
}

static int __devinit macb_probe(struct platform_device *pdev)
static int __init macb_probe(struct platform_device *pdev)
{
struct eth_platform_data *pdata;
struct resource *regs;
Expand Down Expand Up @@ -1248,7 +1248,7 @@ static int __devinit macb_probe(struct platform_device *pdev)
return err;
}

static int __devexit macb_remove(struct platform_device *pdev)
static int __exit macb_remove(struct platform_device *pdev)
{
struct net_device *dev;
struct macb *bp;
Expand Down Expand Up @@ -1276,16 +1276,15 @@ static int __devexit macb_remove(struct platform_device *pdev)
}

static struct platform_driver macb_driver = {
.probe = macb_probe,
.remove = __devexit_p(macb_remove),
.remove = __exit_p(macb_remove),
.driver = {
.name = "macb",
},
};

static int __init macb_init(void)
{
return platform_driver_register(&macb_driver);
return platform_driver_probe(&macb_driver, macb_probe);
}

static void __exit macb_exit(void)
Expand Down

0 comments on commit 06c3fd6

Please sign in to comment.