Message ID | 20191210203149.7115-2-tiny.windzz@gmail.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | [1/5] nvmem: sunxi_sid: convert to devm_platform_ioremap_resource | expand |
There is no 5/5 in this patchset, a small mistake. Thx, Yangtao
On Wed, Dec 11, 2019 at 4:32 AM Yangtao Li <tiny.windzz@gmail.com> wrote: > > Use devm_platform_ioremap_resource() to simplify code. > > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Acked-by: Chen-Yu Tsai <wens@csie.org> > --- > drivers/nvmem/sunxi_sid.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c > index e26ef1bbf198..c54adf60b155 100644 > --- a/drivers/nvmem/sunxi_sid.c > +++ b/drivers/nvmem/sunxi_sid.c > @@ -112,7 +112,6 @@ static int sun8i_sid_read_by_reg(void *context, unsigned int offset, > static int sunxi_sid_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > - struct resource *res; > struct nvmem_config *nvmem_cfg; > struct nvmem_device *nvmem; > struct sunxi_sid *sid; > @@ -129,8 +128,7 @@ static int sunxi_sid_probe(struct platform_device *pdev) > return -EINVAL; > sid->value_offset = cfg->value_offset; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - sid->base = devm_ioremap_resource(dev, res); > + sid->base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(sid->base)) > return PTR_ERR(sid->base); > > -- > 2.17.1 >
diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c index e26ef1bbf198..c54adf60b155 100644 --- a/drivers/nvmem/sunxi_sid.c +++ b/drivers/nvmem/sunxi_sid.c @@ -112,7 +112,6 @@ static int sun8i_sid_read_by_reg(void *context, unsigned int offset, static int sunxi_sid_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct resource *res; struct nvmem_config *nvmem_cfg; struct nvmem_device *nvmem; struct sunxi_sid *sid; @@ -129,8 +128,7 @@ static int sunxi_sid_probe(struct platform_device *pdev) return -EINVAL; sid->value_offset = cfg->value_offset; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - sid->base = devm_ioremap_resource(dev, res); + sid->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(sid->base)) return PTR_ERR(sid->base);
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> --- drivers/nvmem/sunxi_sid.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)