lkml.org 
[lkml]   [2018]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 3/5] serial: sprd: Remove unnecessary resource validation
On 11 August 2018 at 09:34, Baolin Wang <baolin.wang@linaro.org> wrote:
> 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>

> ---
> 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
>

\
 
 \ /
  Last update: 2018-09-04 08:56    [W:0.062 / U:4.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site