From: Baolin Wang Date: Mon, 17 Sep 2018 18:33:42 +0000 (-0700) Subject: serial: sprd: Remove unnecessary resource validation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=262d3dc00730f7a9d835faeca46689d750177e55;p=linux.git 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 Acked-by: Chunyan Zhang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index e18d8afc88ffe..03b0cd45f1edf 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);