Message ID | 1492510354-11300-2-git-send-email-yankejian@huawei.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c index 403ea9d..2da5b42 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c @@ -2971,6 +2971,18 @@ static int hns_dsaf_probe(struct platform_device *pdev) struct dsaf_device *dsaf_dev; int ret; + /* + * Check if we should defer the probe before we probe the + * dsaf, as it's hard to defer later on. + */ + ret = platform_get_irq(pdev, 0); + if (ret < 0) { + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "Cannot obtain irq\n"); + + return ret; + } + dsaf_dev = hns_dsaf_alloc_dev(&pdev->dev, sizeof(struct dsaf_drv_priv)); if (IS_ERR(dsaf_dev)) { ret = PTR_ERR(dsaf_dev);