nvmem: imx-ocotp: use devm_platform_ioremap_resource() to simplify code
Subsystems (2)
PATCH 1/3 nvmem: imx-ocotp: use devm_platform_ioremap_resource() to simplify code
Use the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code.
--- drivers/nvmem/imx-ocotp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/nvmem/imx-ocotp.c +1 -3
@@ -467,7 +467,6 @@ MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids);static int imx_ocotp_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *res;struct ocotp_priv *priv;struct nvmem_device *nvmem;
@@ -477,8 +476,7 @@ static int imx_ocotp_probe(struct platform_device *pdev) priv->dev = dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - priv->base =devm_ioremap_resource (dev, res); + priv->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->base))return PTR_ERR (priv->base);
Signature · 1 line
2.7.4
PATCH 2/3 nvmem: mxs-ocotp: use devm_platform_ioremap_resource() to simplify code
Use the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code.
--- drivers/nvmem/mxs-ocotp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/nvmem/mxs-ocotp.c +1 -3
@@ -145,7 +145,6 @@ static int mxs_ocotp_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;const struct mxs_data *data;struct mxs_ocotp *otp; -struct resource *res;const struct of_device_id *match;int ret;
@@ -157,8 +156,7 @@ static int mxs_ocotp_probe(struct platform_device *pdev)if (!otp)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - otp->base =devm_ioremap_resource (dev, res); + otp->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (otp->base))return PTR_ERR (otp->base);
Signature · 1 line
2.7.4
Re: [PATCH 2/3] nvmem: mxs-ocotp: use devm_platform_ioremap_resource() to simplify code
Quoted 5 lines · Anson Huang
Use the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>
Cheers,
-Mukesh
Quoted 26 lines
--- drivers/nvmem/mxs-ocotp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/nvmem/mxs-ocotp.c +1
-3@@ -145,7 +145,6 @@ static int mxs_ocotp_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;const struct mxs_data *data;struct mxs_ocotp *otp; -struct resource *res;const struct of_device_id *match;int ret;@@ -157,8 +156,7 @@ static int mxs_ocotp_probe(struct platform_device *pdev)if (!otp)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - otp->base =devm_ioremap_resource (dev, res); + otp->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (otp->base))return PTR_ERR (otp->base);
PATCH 3/3 nvmem: imx-iim: use devm_platform_ioremap_resource() to simplify code
In reply to Anson HuangUse the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code.
--- drivers/nvmem/imx-iim.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/nvmem/imx-iim.c +1 -3
@@ -104,7 +104,6 @@ static int imx_iim_probe(struct platform_device *pdev) {const struct of_device_id *of_id;struct device *dev = &pdev->dev; -struct resource *res;struct iim_priv *iim;struct nvmem_device *nvmem;struct nvmem_config cfg = {};
@@ -114,8 +113,7 @@ static int imx_iim_probe(struct platform_device *pdev)if (!iim)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - iim->base =devm_ioremap_resource (dev, res); + iim->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (iim->base))return PTR_ERR (iim->base);
Signature · 1 line
2.7.4
Re: [PATCH 3/3] nvmem: imx-iim: use devm_platform_ioremap_resource() to simplify code
Quoted 5 lines · Anson Huang
Use the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>
Cheers,
-Mukesh
Quoted 26 lines
--- drivers/nvmem/imx-iim.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/nvmem/imx-iim.c +1
-3@@ -104,7 +104,6 @@ static int imx_iim_probe(struct platform_device *pdev) {const struct of_device_id *of_id;struct device *dev = &pdev->dev; -struct resource *res;struct iim_priv *iim;struct nvmem_device *nvmem;struct nvmem_config cfg = {};@@ -114,8 +113,7 @@ static int imx_iim_probe(struct platform_device *pdev)if (!iim)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - iim->base =devm_ioremap_resource (dev, res); + iim->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (iim->base))return PTR_ERR (iim->base);
Quoted 5 lines · Anson Huang
Use the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>
Cheers,
-Mukesh
Quoted 26 lines
--- drivers/nvmem/imx-ocotp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/nvmem/imx-ocotp.c +1
-3@@ -467,7 +467,6 @@ MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids);static int imx_ocotp_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *res;struct ocotp_priv *priv;struct nvmem_device *nvmem;@@ -477,8 +476,7 @@ static int imx_ocotp_probe(struct platform_device *pdev) priv->dev = dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - priv->base =devm_ioremap_resource (dev, res); + priv->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->base))return PTR_ERR (priv->base);
Srinivas Kandagatla
AppliedQuoted 5 lines · Anson Huang
Use the new helper
devm_platform_ioremap_resource()which wraps theplatform_get_resource()anddevm_ioremap_resource()together, to simplify the code.Signed-off-by Anson Huang <[email protected]>
Applied series to nvmem-next
Thanks,
srini