nvmem: sunxi_sid: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230823132744.350618-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d63a422570
commit
9ccfcbeb8f
|
@ -125,7 +125,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;
|
||||
|
@ -142,8 +141,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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue