From: Joachim Eastwood <manabian@gmail.com>
To: peppe.cavallaro@st.com
Cc: Joachim Eastwood <manabian@gmail.com>,
netdev@vger.kernel.org, davem@davemloft.net, arnd@arndb.de,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next 4/4] stmmac: drop unnecessary dt checks in stmmac_probe_config_dt
Date: Wed, 20 May 2015 20:03:09 +0200 [thread overview]
Message-ID: <1432144989-28283-5-git-send-email-manabian@gmail.com> (raw)
In-Reply-To: <1432144989-28283-1-git-send-email-manabian@gmail.com>
Since the caller already check the presence of a of_node there
is no need to repeat the check in stmmac_probe_config_dt.
There is also no point in checking the return value of the
of_match_device function since if there wasn't match in the
first place we would never be in this function.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 10de9351a1ec..d2bb7907bf61 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -111,13 +111,7 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
const struct of_device_id *device;
struct device *dev = &pdev->dev;
- if (!np)
- return -ENODEV;
-
device = of_match_device(dev->driver->of_match_table, dev);
- if (!device)
- return -ENODEV;
-
if (device->data) {
const struct stmmac_of_data *data = device->data;
plat->has_gmac = data->has_gmac;
--
1.8.0
next prev parent reply other threads:[~2015-05-20 18:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 18:03 [PATCH net-next 0/4] stmmac: probe code refactoring and clean up part 1 Joachim Eastwood
2015-05-20 18:03 ` [PATCH net-next 1/4] stmmac: move driver data setting into stmmac_dvr_probe Joachim Eastwood
2015-05-20 18:03 ` [PATCH net-next 2/4] stmmac: let stmmac_dvr_probe take a struct of resources Joachim Eastwood
2015-05-20 18:03 ` [PATCH net-next 3/4] stmmac: change the stmmac_dvr_probe return type to int Joachim Eastwood
2015-05-20 18:03 ` Joachim Eastwood [this message]
2015-05-21 22:57 ` [PATCH net-next 0/4] stmmac: probe code refactoring and clean up part 1 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=1432144989-28283-5-git-send-email-manabian@gmail.com \
--to=manabian@gmail.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.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;
as well as URLs for NNTP newsgroup(s).