Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb82038f authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Artem Bityutskiy
Browse files

mtd: physmap_of: Convert device allocation to managed devm_kzalloc()

parent 84cfbbb8
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -68,9 +68,6 @@ static int of_flash_remove(struct platform_device *dev)
			kfree(info->list[i].res);
		}
	}

	kfree(info);

	return 0;
}

@@ -199,7 +196,8 @@ static int of_flash_probe(struct platform_device *dev)
	map_indirect = of_property_read_bool(dp, "no-unaligned-direct-access");

	err = -ENOMEM;
	info = kzalloc(sizeof(struct of_flash) +
	info = devm_kzalloc(&dev->dev,
			    sizeof(struct of_flash) +
			    sizeof(struct of_flash_list) * count, GFP_KERNEL);
	if (!info)
		goto err_flash_remove;