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

Commit 63bacb52 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "icnss: Avoid wlan driver remove during modem graceful shutdown"

parents f205c292 d4e7976c
Loading
Loading
Loading
Loading
+2 −28
Original line number Diff line number Diff line
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, 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
@@ -2298,29 +2298,6 @@ out:
	return 0;
}

static int icnss_call_driver_remove(struct icnss_priv *priv)
{
	icnss_pr_dbg("Calling driver remove state: 0x%lx\n", priv->state);

	clear_bit(ICNSS_FW_READY, &priv->state);

	if (!test_bit(ICNSS_DRIVER_PROBED, &penv->state))
		return 0;

	if (!priv->ops || !priv->ops->remove)
		return 0;

	set_bit(ICNSS_DRIVER_UNLOADING, &penv->state);
	penv->ops->remove(&priv->pdev->dev);

	clear_bit(ICNSS_DRIVER_UNLOADING, &penv->state);
	clear_bit(ICNSS_DRIVER_PROBED, &priv->state);

	icnss_hw_power_off(penv);

	return 0;
}

static int icnss_fw_crashed(struct icnss_priv *priv,
			    struct icnss_event_pd_service_down_data *event_data)
{
@@ -2356,10 +2333,7 @@ static int icnss_driver_event_pd_service_down(struct icnss_priv *priv,
		goto out;
	}

	if (event_data->crashed)
	icnss_fw_crashed(priv, event_data);
	else
		icnss_call_driver_remove(priv);

out:
	kfree(data);