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

Commit 88a8c0ce authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

memshare: Pass device structure to ramdump driver



The ramdump driver uses the device pointer during ramdump read.
This change passes in the device pointer for memshare during
ramdump create and moves the call to the probe function.

CRs-Fixed: 1079523
Change-Id: I687696dbedfa0ce7e6053d70291a7beb6f81f82e
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 85d7e134
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ static DECLARE_DELAYED_WORK(work_recv_msg, mem_share_svc_recv_msg);
static struct workqueue_struct *mem_share_svc_workqueue;
static uint64_t bootup_request;
static void *memshare_ramdump_dev[MAX_CLIENTS];
static struct device *memshare_dev[MAX_CLIENTS];

/* Memshare Driver Structure */
struct memshare_driver {
@@ -145,9 +146,14 @@ static int mem_share_configure_ramdump(void)
	}

	snprintf(client_name, 18, "memshare_%s", clnt);

	memshare_ramdump_dev[num_clients] = create_ramdump_device(client_name,
								NULL);
	if (memshare_dev[num_clients]) {
		memshare_ramdump_dev[num_clients] =
			create_ramdump_device(client_name,
				memshare_dev[num_clients]);
	} else {
		pr_err("memshare:%s: invalid memshare device\n", __func__);
		return -ENODEV;
	}
	if (IS_ERR_OR_NULL(memshare_ramdump_dev[num_clients])) {
		pr_err("memshare: %s: Unable to create memshare ramdump device.\n",
				__func__);
@@ -957,6 +963,8 @@ static int memshare_child_probe(struct platform_device *pdev)
	 *  memshare clients
	 */

	memshare_dev[num_clients] = &pdev->dev;

	if (!memblock[num_clients].file_created) {
		rc = mem_share_configure_ramdump();
		if (rc)