From: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
To: ssantosh@kernel.org, s-anna@ti.com
Cc: grzegorz.jaszczyk@linaro.org, santosh.shilimkar@oracle.com,
lee.jones@linaro.org, linux-kernel@vger.kernel.org,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
praneeth@ti.com, tony@atomide.com,
Wei Yongjun <weiyongjun1@huawei.com>
Subject: [PATCH] soc: ti: pruss: Remove wrong check against *get_match_data return value
Date: Mon, 26 Oct 2020 15:49:43 +0100 [thread overview]
Message-ID: <20201026144943.30821-1-grzegorz.jaszczyk@linaro.org> (raw)
Since the of_device_get_match_data() doesn't return error code, remove
wrong IS_ERR test. Proper check against NULL pointer is already done
later before usage: if (data && data->...).
Additionally, proceeding with empty device data is valid (e.g. in case
of "ti,am3356-pruss").
Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
---
drivers/soc/ti/pruss.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index cc0b4ad7a3d3..5d6e7132a5c4 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -126,8 +126,6 @@ static int pruss_clk_init(struct pruss *pruss, struct device_node *cfg_node)
int ret = 0;
data = of_device_get_match_data(dev);
- if (IS_ERR(data))
- return -ENODEV;
clks_np = of_get_child_by_name(cfg_node, "clocks");
if (!clks_np) {
@@ -175,10 +173,6 @@ static int pruss_probe(struct platform_device *pdev)
const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" };
data = of_device_get_match_data(&pdev->dev);
- if (IS_ERR(data)) {
- dev_err(dev, "missing private data\n");
- return -ENODEV;
- }
ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
if (ret) {
--
2.29.0
next reply other threads:[~2020-10-26 14:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 14:49 Grzegorz Jaszczyk [this message]
2020-11-10 20:42 ` [PATCH] soc: ti: pruss: Remove wrong check against *get_match_data return value Suman Anna
2020-11-16 17:17 ` Grzegorz Jaszczyk
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=20201026144943.30821-1-grzegorz.jaszczyk@linaro.org \
--to=grzegorz.jaszczyk@linaro.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=praneeth@ti.com \
--cc=s-anna@ti.com \
--cc=santosh.shilimkar@oracle.com \
--cc=ssantosh@kernel.org \
--cc=tony@atomide.com \
--cc=weiyongjun1@huawei.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).