Commit 1a805883 authored by Yangtao Li's avatar Yangtao Li Committed by Sebastian Reichel
Browse files

power: reset: ocelot: Convert to devm_platform_ioremap_resource()



Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 19223ffa
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -69,8 +69,6 @@ static int ocelot_restart_handle(struct notifier_block *this,
static int ocelot_reset_probe(struct platform_device *pdev)
static int ocelot_reset_probe(struct platform_device *pdev)
{
{
	struct ocelot_reset_context *ctx;
	struct ocelot_reset_context *ctx;
	struct resource *res;

	struct device *dev = &pdev->dev;
	struct device *dev = &pdev->dev;
	int err;
	int err;


@@ -78,8 +76,7 @@ static int ocelot_reset_probe(struct platform_device *pdev)
	if (!ctx)
	if (!ctx)
		return -ENOMEM;
		return -ENOMEM;


	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	ctx->base = devm_platform_ioremap_resource(pdev, 0);
	ctx->base = devm_ioremap_resource(dev, res);
	if (IS_ERR(ctx->base))
	if (IS_ERR(ctx->base))
		return PTR_ERR(ctx->base);
		return PTR_ERR(ctx->base);