lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210814131418.13608-1-tangbin@cmss.chinamobile.com>
Date:   Sat, 14 Aug 2021 21:14:18 +0800
From:   Tang Bin <tangbin@...s.chinamobile.com>
To:     gregkh@...uxfoundation.org, jirislaby@...nel.org,
        mcoquelin.stm32@...il.com, alexandre.torgue@...s.st.com
Cc:     linux-serial@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Tang Bin <tangbin@...s.chinamobile.com>,
        Zhang Shengju <zhangshengju@...s.chinamobile.com>
Subject: [PATCH] serial: stm32: use devm_platform_get_and_ioremap_resource()

Use devm_platform_get_and_ioremap_resource() to simplify code.

Signed-off-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
---
 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;
-- 
2.20.1.windows.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ