Commit 1dc552fa authored by Yang Li's avatar Yang Li Committed by Greg Kroah-Hartman

nvmem: bcm-ocotp: Use devm_platform_ioremap_resource()

According to commit 7945f929 ("drivers: provide
devm_platform_ioremap_resource()"), convert platform_get_resource(),
devm_ioremap_resource() to a single call to use
devm_platform_ioremap_resource(), as this is exactly what this function
does.
Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230404172148.82422-31-srinivas.kandagatla@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cc25eba0
...@@ -244,7 +244,6 @@ MODULE_DEVICE_TABLE(acpi, bcm_otpc_acpi_ids); ...@@ -244,7 +244,6 @@ MODULE_DEVICE_TABLE(acpi, bcm_otpc_acpi_ids);
static int bcm_otpc_probe(struct platform_device *pdev) static int bcm_otpc_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct resource *res;
struct otpc_priv *priv; struct otpc_priv *priv;
struct nvmem_device *nvmem; struct nvmem_device *nvmem;
int err; int err;
...@@ -259,8 +258,7 @@ static int bcm_otpc_probe(struct platform_device *pdev) ...@@ -259,8 +258,7 @@ static int bcm_otpc_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
/* Get OTP base address register. */ /* Get OTP base address register. */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->base = devm_platform_ioremap_resource(pdev, 0);
priv->base = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->base)) { if (IS_ERR(priv->base)) {
dev_err(dev, "unable to map I/O memory\n"); dev_err(dev, "unable to map I/O memory\n");
return PTR_ERR(priv->base); return PTR_ERR(priv->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment