From: Fugang Duan <fugang.duan@nxp.com>
To: <festevam@gmail.com>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <troy.kisky@boundarydevices.com>,
<andrew@lunn.ch>, <fugang.duan@nxp.com>
Subject: [PATCH v2 net,stable 2/2] net: fec: defer probe if regulator is not ready
Date: Wed, 3 Jan 2018 10:39:30 +0800 [thread overview]
Message-ID: <1514947170-8887-3-git-send-email-fugang.duan@nxp.com> (raw)
In-Reply-To: <1514947170-8887-1-git-send-email-fugang.duan@nxp.com>
Defer probe if regulator is not ready. E.g. some regulator is fixed
regulator controlled by i2c expander gpio, the i2c device may be probed
after the driver, then it should handle the case of defer probe error.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
---
drivers/net/ethernet/freescale/fec_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index dae89bc..feed383 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3489,6 +3489,10 @@ static int fec_enet_get_irq_cnt(struct platform_device *pdev)
goto failed_regulator;
}
} else {
+ if (PTR_ERR(fep->reg_phy) == -EPROBE_DEFER) {
+ ret = -EPROBE_DEFER;
+ goto failed_regulator;
+ }
fep->reg_phy = NULL;
}
--
1.9.1
next prev parent reply other threads:[~2018-01-03 2:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 2:39 [PATCH v2 net,stable 0/2] net: fec: clean up in the cases of probe error Fugang Duan
2018-01-03 2:39 ` [PATCH v2 net,stable 1/2] net: fec: restore dev_id " Fugang Duan
2018-01-03 20:03 ` Troy Kisky
2018-01-03 2:39 ` Fugang Duan [this message]
2018-01-03 16:40 ` [PATCH v2 net,stable 0/2] net: fec: clean up " David Miller
2018-01-04 2:07 ` Andy Duan
2018-01-04 2:20 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1514947170-8887-3-git-send-email-fugang.duan@nxp.com \
--to=fugang.duan@nxp.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=festevam@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=troy.kisky@boundarydevices.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox