From: Baolin Wang <baolin.wang@linaro.org>
To: gregkh@linuxfoundation.org, jslaby@suse.com
Cc: orsonzhai@gmail.com, baolin.wang@linaro.org,
zhang.lyra@gmail.com, broonie@kernel.org,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/5] serial: sprd: Remove unnecessary resource validation
Date: Fri, 10 Aug 2018 18:34:25 -0700 [thread overview]
Message-ID: <b48edead2c6abb862b121d347b01bf07dec818ea.1533950271.git.baolin.wang@linaro.org> (raw)
In-Reply-To: <50e1f7f4673bff9d71936b4eb34cbf2571b0fda9.1533950271.git.baolin.wang@linaro.org>
In-Reply-To: <50e1f7f4673bff9d71936b4eb34cbf2571b0fda9.1533950271.git.baolin.wang@linaro.org>
The devm_ioremap_resource() will valid the resources, thus remove the
unnecessary resource validation in the driver.
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/tty/serial/sprd_serial.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index e18d8af..03b0cd4 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -710,15 +710,12 @@ static int sprd_probe(struct platform_device *pdev)
up->uartclk = clk_get_rate(clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(&pdev->dev, "not provide mem resource\n");
- return -ENODEV;
- }
- up->mapbase = res->start;
up->membase = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(up->membase))
return PTR_ERR(up->membase);
+ up->mapbase = res->start;
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "not provide irq resource: %d\n", irq);
--
1.9.1
next prev parent reply other threads:[~2018-08-11 1:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-11 1:34 [PATCH 1/5] serial: sprd: Remove unused structure Baolin Wang
2018-08-11 1:34 ` [PATCH 2/5] serial: sprd: Use readable macros instead of magic number Baolin Wang
2018-09-04 6:54 ` Chunyan Zhang
2018-08-11 1:34 ` Baolin Wang [this message]
2018-09-04 6:55 ` [PATCH 3/5] serial: sprd: Remove unnecessary resource validation Chunyan Zhang
2018-08-11 1:34 ` [PATCH 4/5] serial: sprd: Change 'int' to 'unsigned int' Baolin Wang
2018-09-04 6:55 ` Chunyan Zhang
2018-08-11 1:34 ` [PATCH 5/5] serial: sprd: Fix the indentation issue Baolin Wang
2018-09-04 6:57 ` Chunyan Zhang
2018-09-04 5:34 ` [PATCH 1/5] serial: sprd: Remove unused structure Baolin Wang
2018-09-04 6:52 ` Chunyan Zhang
2018-09-11 6:09 ` Baolin Wang
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=b48edead2c6abb862b121d347b01bf07dec818ea.1533950271.git.baolin.wang@linaro.org \
--to=baolin.wang@linaro.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=orsonzhai@gmail.com \
--cc=zhang.lyra@gmail.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
all inboxes | Powered by JetHome®