summaryrefslogtreecommitdiff
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-08-23 16:27:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-23 17:34:00 +0300
commit0b49178e2b6b4aac3c7fa3ce8d8c02208a13b988 (patch)
tree7d21dd23bbca7555f13f70dec2a5a01271791e95 /drivers/nvmem
parentcfadd0e7d9225566f320bc4dc716682be910be6c (diff)
downloadlinux-0b49178e2b6b4aac3c7fa3ce8d8c02208a13b988.tar.xz
nvmem: lpc18xx_otp: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230823132744.350618-5-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/lpc18xx_otp.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/nvmem/lpc18xx_otp.c b/drivers/nvmem/lpc18xx_otp.c
index 16c92ea85d49..8faed05e3cbe 100644
--- a/drivers/nvmem/lpc18xx_otp.c
+++ b/drivers/nvmem/lpc18xx_otp.c
@@ -68,14 +68,12 @@ static int lpc18xx_otp_probe(struct platform_device *pdev)
{
struct nvmem_device *nvmem;
struct lpc18xx_otp *otp;
- struct resource *res;
otp = devm_kzalloc(&pdev->dev, sizeof(*otp), GFP_KERNEL);
if (!otp)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- otp->base = devm_ioremap_resource(&pdev->dev, res);
+ otp->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(otp->base))
return PTR_ERR(otp->base);