mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
mfd: atmel-hlcdc: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230706113939.1178-1-frank.li@vivo.com Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
d085c27aa6
commit
8e950a6068
1 changed files with 1 additions and 3 deletions
|
@ -83,7 +83,6 @@ static int atmel_hlcdc_probe(struct platform_device *pdev)
|
|||
struct atmel_hlcdc_regmap *hregmap;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct atmel_hlcdc *hlcdc;
|
||||
struct resource *res;
|
||||
|
||||
hregmap = devm_kzalloc(dev, sizeof(*hregmap), GFP_KERNEL);
|
||||
if (!hregmap)
|
||||
|
@ -93,8 +92,7 @@ static int atmel_hlcdc_probe(struct platform_device *pdev)
|
|||
if (!hlcdc)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
hregmap->regs = devm_ioremap_resource(dev, res);
|
||||
hregmap->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(hregmap->regs))
|
||||
return PTR_ERR(hregmap->regs);
|
||||
|
||||
|
|
Loading…
Reference in a new issue