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>
This commit is contained in:
parent
cfadd0e7d9
commit
0b49178e2b
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user