From patchwork Mon Sep 17 18:33:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 146857 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4099799ljw; Mon, 17 Sep 2018 11:34:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdboFrKV59xUFCgXuTMuJpoHwwiwlzGu7A2kQZPTLWlDUHOEIby2GTsDkbGeg6aF9/0xIciX X-Received: by 2002:a63:d70e:: with SMTP id d14-v6mr24916118pgg.110.1537209271668; Mon, 17 Sep 2018 11:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537209271; cv=none; d=google.com; s=arc-20160816; b=DNmg0Kz4h/+ZzIl2MrAJmsoALff4irzrix+mvmtE0TqthsFyk/7tRMmfJBbprtpFAz 0OvLWAJoSV3IaA/d3uhdi5n0jGRNEsX3Q80jWYsiuBXHLjw5EQ1NLCAehobNuxi4y2gq 25DvuTqTGGqSxW9G8NnzSCoCdNGotMU6RlG8BLSacamvGpHqLXBPYs73ZB3rEfa0KCAc C7apwpa5GpECj55Wp4l6xFcwr6u0n1llU8yE1ogq90vMDMpm52QgwQXtqDyQKrqvtqfr N7rXT9BFat+ML53P2dZj4EVdGnd586esr7jCDBbz3pS6qVE+lluKlo342NhxOAb1PiTA CAxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=ltLNIPFLQyeoJzz76sivioQ9yctXRHCKZQ+WN0q2SaM=; b=RCMO0ci1YKDq60thpl+IGNsY0BjRMDN5ZSXaR4D+wxNF5+GWpxvmt9jKNkfeFy+UrO Q24/UBHJlKR85nohSdqhian+X67g6a8zYwLJ5nWLEEef8Ez7zWZKOEaOg5htd8alb19I Mpd5MqP66ZwY7xFlK8Rhf0O3i0nHfagLpatj6oWq3R8GAFohhAF8vO5ZC/FUqlHE/EBu 36neByge2N1+UPNSFBmQvjFRjFZVCUzrhGCHadP3pdya6GERGY1LjIMJXomRgeCo8mUf Jh9AU2acknXwOyKU7DqG3FMUDFU3QlJvfdoxH32+dYz1Q3UZEoyMOFs/MU3uFiw73oJk V5Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CIoaKfN2; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i64-v6si16750348pfb.314.2018.09.17.11.34.31; Mon, 17 Sep 2018 11:34:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CIoaKfN2; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728396AbeIRADD (ORCPT + 2 others); Mon, 17 Sep 2018 20:03:03 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44329 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728380AbeIRADD (ORCPT ); Mon, 17 Sep 2018 20:03:03 -0400 Received: by mail-pf1-f194.google.com with SMTP id k21-v6so7953204pff.11 for ; Mon, 17 Sep 2018 11:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=ltLNIPFLQyeoJzz76sivioQ9yctXRHCKZQ+WN0q2SaM=; b=CIoaKfN2eySOLQs0TGAuKs75AahlejX/lyY3GO2XfIkfbPpz+exypfcOSnjJSLm3W+ n92b4ZTqsgyx5wO8XvdNLTdlm1K1q4OFWcoZ1+6XzAgpk+VNPMyiwpTpQ+h89u0dXrMC D5wYQfJ/hLhY+f1YcwDLLryTSTY618RFzlTJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ltLNIPFLQyeoJzz76sivioQ9yctXRHCKZQ+WN0q2SaM=; b=bMA5T79QkpIeZEKcQgzVztgTwSBIn/Ezkhxdq24M+3o+utje2ewzfOzuqjy1+ulX7D Rz88z9EtiIl+5xigY0d8eM/UhfK0s1HYW10+eJYgRmGurJpACmN9sS6xfyCY7I/c0LfN jRbuX3hZkxXgtjHX/zWx2ikLpY6dk+BA76OssXcAfQceX895YuJ8RnFiGfIlsrBDy/0s hFZSlCtnq+T8ywdKdq2LtckF6tLWeAnJA/xb7B3aveb7wFLMoCxWg6vaXx6D+Cjx3o+Y 8orLhha3vBJpbm3+gUG37ScJRMl0KN6wCbaoTFUeFtpCUGXN4y+qpHQTXJwS1XV7ZBUZ Obrg== X-Gm-Message-State: APzg51CxB/G36OCr76rJNmNhhIWw8gfg7AoUWuWzmXhWFgHK+aXfRIay WcqkBf4fJvSFkL4vzujA1wwiDA== X-Received: by 2002:a65:5581:: with SMTP id j1-v6mr24167193pgs.203.1537209269843; Mon, 17 Sep 2018 11:34:29 -0700 (PDT) Received: from ubuntu.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id i7-v6sm17544137pgs.17.2018.09.17.11.34.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Sep 2018 11:34:29 -0700 (PDT) From: Baolin Wang 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 v2 3/5] serial: sprd: Remove unnecessary resource validation Date: Mon, 17 Sep 2018 11:33:42 -0700 Message-Id: <8aa7a92468beb45348bf113696deb263c3f27792.1537208449.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 --- Changes from v1: - Add acked tag from Chunyan. --- drivers/tty/serial/sprd_serial.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 1.9.1 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);