lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1409655759-28849-1-git-send-email-irina.tirdea@intel.com>
Date:	Tue,  2 Sep 2014 14:02:39 +0300
From:	Irina Tirdea <irina.tirdea@...el.com>
To:	Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org
Cc:	Hartmut Knaack <knaack.h@....de>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Peter Meerwald <pmeerw@...erw.net>,
	Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
	linux-kernel@...r.kernel.org, Irina Tirdea <irina.tirdea@...el.com>
Subject: [PATCH] iio: gyro: bmg160: only set power state if PM_RUNTIME is defined

When CONFIG_PM_RUNTIME is not defined and bmg160 tries to power
off the device, bmg160_set_power_state will call pm_runtime_put_autosuspend,
which is not implemented (wil return -ENOSYS).

Only call bmg160_set_power_state when CONFIG_PM_RUNTIME is defined.

Signed-off-by: Irina Tirdea <irina.tirdea@...el.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
---
 drivers/iio/gyro/bmg160.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/iio/gyro/bmg160.c b/drivers/iio/gyro/bmg160.c
index 7524698..e41d6b5 100644
--- a/drivers/iio/gyro/bmg160.c
+++ b/drivers/iio/gyro/bmg160.c
@@ -235,6 +235,7 @@ static int bmg160_chip_init(struct bmg160_data *data)
 	return 0;
 }
 
+#ifdef CONFIG_PM_RUNTIME
 static int bmg160_set_power_state(struct bmg160_data *data, bool on)
 {
 	int ret;
@@ -254,6 +255,12 @@ static int bmg160_set_power_state(struct bmg160_data *data, bool on)
 
 	return 0;
 }
+#else
+static int bmg160_set_power_state(struct bmg160_data *data, bool on)
+{
+	return 0;
+}
+#endif
 
 static int bmg160_setup_any_motion_interrupt(struct bmg160_data *data,
 					     bool status)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ