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

Commit 0438976d authored by Arun KS's avatar Arun KS Committed by Raghavendra Rao Ananta
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 2807b5c0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -748,6 +748,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");
@@ -818,6 +819,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");
@@ -906,6 +908,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");
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ struct esoc_eng {
 * @link_info: additional info about 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
@@ -66,6 +67,7 @@ struct esoc_clink {
	const char *link_info;
	struct device *parent;
	struct device dev;
	struct platform_device *pdev;
	unsigned int id;
	struct module *owner;
	const struct esoc_clink_ops *clink_ops;
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,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_OR_NULL(esoc_clink->subsys_dev)) {
		dev_err(&esoc_clink->dev, "failed to register ssr node\n");