summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-16 13:29:50 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-16 13:29:50 -0800
commitfc8e309f193ed11b1d2b7c9581d243a551eeadfe (patch)
treedea145a07ed033376acb6abdbc5266b7c1b50c88
parentbb64ae8a4776726bae8ef9f1431a649930fb42db (diff)
parent4d5af6434692e2f878c0079528ecb0a226b1fa64 (diff)
Merge "power: reset: fix compilation errors when dload disabled."
-rw-r--r--drivers/power/reset/msm-poweroff.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c
index cd02ed5bd46a..38e822de34a7 100644
--- a/drivers/power/reset/msm-poweroff.c
+++ b/drivers/power/reset/msm-poweroff.c
@@ -48,7 +48,7 @@
static int restart_mode;
-static void *restart_reason, *dload_type_addr;
+static void *restart_reason;
static bool scm_pmic_arbiter_disable_supported;
static bool scm_deassert_ps_hold_supported;
/* Download mode master kill-switch */
@@ -60,8 +60,6 @@ static void scm_disable_sdi(void);
* There is no API from TZ to re-enable the registers.
* So the SDI cannot be re-enabled when it already by-passed.
*/
-static int download_mode = 1;
-static struct kobject dload_kobj;
#ifdef CONFIG_QCOM_DLOAD_MODE
#define EDL_MODE_PROP "qcom,msm-imem-emergency_download_mode"
@@ -71,7 +69,9 @@ static struct kobject dload_kobj;
#endif
static int in_panic;
-static void *dload_mode_addr;
+static int download_mode = 1;
+static struct kobject dload_kobj;
+static void *dload_mode_addr, *dload_type_addr;
static bool dload_mode_enabled;
static void *emergency_dload_mode_addr;
#ifdef CONFIG_RANDOMIZE_BASE
@@ -268,9 +268,9 @@ static void halt_spmi_pmic_arbiter(void)
static void msm_restart_prepare(const char *cmd)
{
-#ifdef CONFIG_QCOM_DLOAD_MODE
bool need_warm_reset = false;
+#ifdef CONFIG_QCOM_DLOAD_MODE
/* Write download mode flags if we're panic'ing
* Write download mode flags if restart_mode says so
@@ -409,6 +409,7 @@ static void do_msm_poweroff(void)
return;
}
+#ifdef CONFIG_QCOM_DLOAD_MODE
static ssize_t attr_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{
@@ -486,6 +487,7 @@ static struct attribute *reset_attrs[] = {
static struct attribute_group reset_attr_group = {
.attrs = reset_attrs,
};
+#endif
static int msm_restart_probe(struct platform_device *pdev)
{
@@ -599,11 +601,12 @@ skip_sysfs_create:
if (scm_is_call_available(SCM_SVC_PWR, SCM_IO_DEASSERT_PS_HOLD) > 0)
scm_deassert_ps_hold_supported = true;
+#ifdef CONFIG_QCOM_DLOAD_MODE
download_mode = scm_is_secure_device();
set_dload_mode(download_mode);
if (!download_mode)
scm_disable_sdi();
-
+#endif
return 0;
err_restart_reason: