Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4308134imm; Mon, 17 Sep 2018 11:35:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYOs2qZs9SKqs67w5/Ab9mblJ3ZX55SdetYUqP7pE3TxyLgTxYfhlIr1LuEwgkuKB+z7TB3 X-Received: by 2002:aa7:8087:: with SMTP id v7-v6mr27026892pff.38.1537209304004; Mon, 17 Sep 2018 11:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537209303; cv=none; d=google.com; s=arc-20160816; b=O7hFBR+neVMPSqUL6Z68m9BckQA7vQSNEl5q0CEGjbqG4Di1jL0SWWV+N6SF1sbfLN IQLsgN8KiNuytD4Ij7zKKzqevCGDJR9w3Ac8qTaH89rQxpl2ghXoFi/kLwTkhl8jegRU KP81w4Oyzt0KTtGdBezGs3yaohMz80t5Row7tfiemmoGoHGqfeHpGwTfnWrj2bmP9QBV 2U77S9NtvoaQ3EmXmicVQSrkoSX6MJAYylD1NAQfidPz/8UjltLcgbFq+OggVAKYQGJV kUfZlHCoKlHH/QI9Dcw+k4IPp+WQDzGVdaQ0tqtWvgUlqjihamDWSukd72Ar0xs8f9Zz GzZA== 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=CwhQLn8SdUR6vifX4+0xyAWxrL2N3AUw2ielKj+f6IOx8LtHPZYKtE2lOsFm50T332 CL/kp2TKXZe7oa+kIm0sd/kcSLu15Onervi9AHYhjFKQTGwFpmjt6p5S9TVsE7OJI8AW WTeiT4aDb/lUAyjmFY5Z8/JrkerTv/y20ghQrU/GnlWxqWtF3AwjvoMbb9anPGosY8ci mBFsrDey10LuW+Tzcd/B0WAdCJ/Mna4TSluSgDi6OwTGFF3nZRFlOP0iVJMEnyntZ/Rx dHzyxuJo6QDj/lzz/eBGHRyjepFV2AYS4CgF0yF3q+kUwUNTYA/FlS2xHucXmwsA1Dye uVWw== 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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 d3-v6si16546973pla.37.2018.09.17.11.34.48; Mon, 17 Sep 2018 11:35:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1728417AbeIRADD (ORCPT + 99 others); Mon, 17 Sep 2018 20:03:03 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34061 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728382AbeIRADD (ORCPT ); Mon, 17 Sep 2018 20:03:03 -0400 Received: by mail-pf1-f195.google.com with SMTP id k19-v6so7972559pfi.1 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=m9suF17bRN9KzxCeHzNZBLjMUDJ1+1NkFO4LyZTqDHIq9GdKh8Ap5M9BeyB/7RfYvy VZDKi283VBfsPoAT2H6HVEFgjrvbhEmtgP/2BIRaVkFSlCsDswWVDCKmJJycLWXgA9hk DHKSfeGFomvyRCjYfDahwoTi/jyXUPig67RkMbKRQwN3S0kMWQ+H7m+XmTEPAuHCsU7N Mclr7pGVYUYc6GbZfWiERPXIkQW6q8GVKMiRlaiJMfVHu7f7Ar1te0cxRZ9D1tbHSH+q beSY6PzPnIogpoRer3/7ic5lvG/oD76XQYXYT/5GO+O4HwSFpHvGjh1Y7WUoKMI5Wejd OXcA== X-Gm-Message-State: APzg51CzAL5KNt9Yok0CMk9ZhlkJ9LrxC7hg5yoE8i4Qw9ZyftlvvvT5 9JKvg6T37lWljc/91w6JJK9Fgg== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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