Skip to content

Commit

Permalink
net: macb: allow deffered probe of the driver
Browse files Browse the repository at this point in the history
The driver is trying to acquire clocks which maybe
are not available yet. Allow the driver to request
deffered probe by providing a probe function and
registering it with module_platform_driver. [1]
This patch is based on 3.19-rc5.

[1] https://lkml.org/lkml/2013/9/23/118

Signed-off-by: Nicolae Rosia <nicolae.rosia@certsign.ro>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nicolae Rosia authored and David S. Miller committed Jan 27, 2015
1 parent 08bfc9c commit 9e86d76
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/net/ethernet/cadence/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ static void macb_probe_queues(void __iomem *mem,
(*num_queues)++;
}

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

static int __exit macb_remove(struct platform_device *pdev)
static int macb_remove(struct platform_device *pdev)
{
struct net_device *dev;
struct macb *bp;
Expand Down Expand Up @@ -2507,15 +2507,16 @@ static int macb_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(macb_pm_ops, macb_suspend, macb_resume);

static struct platform_driver macb_driver = {
.remove = __exit_p(macb_remove),
.probe = macb_probe,
.remove = macb_remove,
.driver = {
.name = "macb",
.of_match_table = of_match_ptr(macb_dt_ids),
.pm = &macb_pm_ops,
},
};

module_platform_driver_probe(macb_driver, macb_probe);
module_platform_driver(macb_driver);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Cadence MACB/GEM Ethernet driver");
Expand Down

0 comments on commit 9e86d76

Please sign in to comment.