aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/tty/serial/sprd_serial.c
diff options
context:
space:
mode:
authorBaolin Wang <baolin.wang@linaro.org>2018-09-17 11:33:42 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-18 16:07:24 +0200
commit262d3dc00730f7a9d835faeca46689d750177e55 (patch)
tree606cb60eab9f323e3664a75c693ca920400bf898 /drivers/tty/serial/sprd_serial.c
parentserial: sprd: Use readable macros instead of magic number (diff)
downloadwireguard-linux-262d3dc00730f7a9d835faeca46689d750177e55.tar.xz
wireguard-linux-262d3dc00730f7a9d835faeca46689d750177e55.zip
serial: sprd: Remove unnecessary resource validation
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> Acked-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/sprd_serial.c')
-rw-r--r--drivers/tty/serial/sprd_serial.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index e18d8afc88ff..03b0cd45f1ed 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);