From patchwork Sat Aug 14 13:14:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tang Bin X-Patchwork-Id: 12436687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,TVD_SPACE_RATIO, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D0EAC4338F for ; Sat, 14 Aug 2021 13:16:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 69B77608FC for ; Sat, 14 Aug 2021 13:16:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 69B77608FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=H4pRC6VlHWa6UerN4RBRdfKQkYSt2ZdgMDt+zOqXTt8=; b=sfEFfVea7mpp/x wkEHBmwY9WOMw7upyB+UfffNBG6rtTcUAoCmCJ+a4Y+DTr8ItWc+xX7+looaXpEVnQebQ+QLmQMGU etWPOUqQ7sRpjxreE6dVM2OPJOIsOMb8Q2GfMutbeGdvTs0eHevJ2zA7oydRnXUL1jLyG/WdWk2gR mGQ/kPVkgg1Zl9YamBm+/LPkNiXWPa4l5QSIBIdlgDQCJxCZdfyOqsU+ayoLzjb6LJy9+AkMXbeDD EIJFRWckeOQBHSyRIS6uWDRfelrCcN9PjNXyqIG070MOUit4mKoP0k88xzldXZyBRfaVjPCbFiFp1 xgz/rmPNJ3inALVHd7ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEtUG-00EBBl-SS; Sat, 14 Aug 2021 13:14:09 +0000 Received: from cmccmta2.chinamobile.com ([221.176.66.80]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEtUB-00EBAW-04 for linux-arm-kernel@lists.infradead.org; Sat, 14 Aug 2021 13:14:07 +0000 Received: from spf.mail.chinamobile.com (unknown[172.16.121.9]) by rmmx-syy-dmz-app05-12005 (RichMail) with SMTP id 2ee56117c17db34-8cde0; Sat, 14 Aug 2021 21:13:38 +0800 (CST) X-RM-TRANSID: 2ee56117c17db34-8cde0 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[112.22.250.151]) by rmsmtp-syy-appsvr05-12005 (RichMail) with SMTP id 2ee56117c17dce6-27868; Sat, 14 Aug 2021 21:13:37 +0800 (CST) X-RM-TRANSID: 2ee56117c17dce6-27868 From: Tang Bin To: gregkh@linuxfoundation.org, jirislaby@kernel.org, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com Cc: linux-serial@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tang Bin , Zhang Shengju Subject: [PATCH] serial: stm32: use devm_platform_get_and_ioremap_resource() Date: Sat, 14 Aug 2021 21:14:18 +0800 Message-Id: <20210814131418.13608-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210814_061403_767656_E766DDCF X-CRM114-Status: UNSURE ( 7.08 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin --- drivers/tty/serial/stm32-usart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 090822cd1..d4ea86e28 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1064,8 +1064,7 @@ static int stm32_usart_init_port(struct stm32_port *stm32port, &stm32port->txftcfg); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - port->membase = devm_ioremap_resource(&pdev->dev, res); + port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(port->membase)) return PTR_ERR(port->membase); port->mapbase = res->start;