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

Commit 40116ce2 authored by Arun KS's avatar Arun KS
Browse files

esoc: Fix integration with SSR driver



SSR driver expects subsystem descriptor device type to be
struct platform_device, whereas esoc driver is passing a
struct device instead. This results in a NULL pointer crash
during platform_get_irq in subsystem_restart.c. Fix esoc
driver to pass platform_device.

Change-Id: I93d02623cb7ac14ea3171c3792a4c52c73a74dea
Signed-off-by: default avatarArun KS <arunks@codeaurora.org>
Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@codeaurora.org>
parent b07050a4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -747,6 +747,7 @@ static int mdm9x25_setup_hw(struct mdm_ctrl *mdm,
		dev_err(mdm->dev, "cannot allocate esoc device\n");
		return PTR_ERR(esoc);
	}
	esoc->pdev = pdev;
	mdm->mdm_queue = alloc_workqueue("mdm_queue", 0, 0);
	if (!mdm->mdm_queue) {
		dev_err(mdm->dev, "could not create mdm_queue\n");
@@ -817,6 +818,7 @@ static int mdm9x35_setup_hw(struct mdm_ctrl *mdm,
		dev_err(mdm->dev, "cannot allocate esoc device\n");
		return PTR_ERR(esoc);
	}
	esoc->pdev = pdev;
	mdm->mdm_queue = alloc_workqueue("mdm_queue", 0, 0);
	if (!mdm->mdm_queue) {
		dev_err(mdm->dev, "could not create mdm_queue\n");
@@ -905,6 +907,7 @@ static int mdm9x55_setup_hw(struct mdm_ctrl *mdm,
		dev_err(mdm->dev, "cannot allocate esoc device\n");
		return PTR_ERR(esoc);
	}
	esoc->pdev = pdev;
	mdm->mdm_queue = alloc_workqueue("mdm_queue", 0, 0);
	if (!mdm->mdm_queue) {
		dev_err(mdm->dev, "could not create mdm_queue\n");
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2015, 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -48,6 +48,7 @@ struct esoc_eng {
 * @link_name: name of the physical link.
 * @parent: parent device.
 * @dev: device for userspace interface.
 * @pdev: platform device to interface with SSR driver.
 * @id: id of the external device.
 * @owner: owner of the device.
 * @clink_ops: control operations for the control link
@@ -64,6 +65,7 @@ struct esoc_clink {
	const char *link_name;
	struct device *parent;
	struct device dev;
	struct platform_device *pdev;
	unsigned int id;
	struct module *owner;
	const struct esoc_clink_ops const *clink_ops;
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2015, 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -180,7 +180,7 @@ int esoc_clink_register_ssr(struct esoc_clink *esoc_clink)
	snprintf(subsys_name, len, "esoc%d", esoc_clink->id);
	esoc_clink->subsys.name = subsys_name;
	esoc_clink->dev.of_node = esoc_clink->np;
	esoc_clink->subsys.dev = &esoc_clink->dev;
	esoc_clink->subsys.dev = &esoc_clink->pdev->dev;
	esoc_clink->subsys_dev = subsys_register(&esoc_clink->subsys);
	if (IS_ERR(esoc_clink->subsys_dev)) {
		dev_err(&esoc_clink->dev, "failed to register ssr node\n");