linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: hid-sensors: convert HID_SENSOR_ENUM_BASE_QUIRKS to bool
@ 2012-10-22  7:57 Kirill A. Shutemov
  2012-10-31 10:35 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Kirill A. Shutemov @ 2012-10-22  7:57 UTC (permalink / raw)
  To: srinivas pandruvada, Jonathan Cameron
  Cc: linux-iio, linux-kernel, Kirill A. Shutemov

From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

It's non-sense to use tristate for the option, it's bool.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 drivers/iio/common/hid-sensors/Kconfig              |    2 +-
 drivers/iio/common/hid-sensors/hid-sensor-trigger.c |    6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/common/hid-sensors/Kconfig b/drivers/iio/common/hid-sensors/Kconfig
index 8e63d81..ae10778 100644
--- a/drivers/iio/common/hid-sensors/Kconfig
+++ b/drivers/iio/common/hid-sensors/Kconfig
@@ -15,7 +15,7 @@ config HID_SENSOR_IIO_COMMON
 	  attributes.
 
 config HID_SENSOR_ENUM_BASE_QUIRKS
-	tristate "ENUM base quirks for HID Sensor IIO drivers"
+	bool "ENUM base quirks for HID Sensor IIO drivers"
 	depends on HID_SENSOR_IIO_COMMON
 	help
 	  Say yes here to build support for sensor hub FW using
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index d4b790d..d60198a 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -36,10 +36,8 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig,
 	int state_val;
 
 	state_val = state ? 1 : 0;
-#if (defined CONFIG_HID_SENSOR_ENUM_BASE_QUIRKS) || \
-	(defined CONFIG_HID_SENSOR_ENUM_BASE_QUIRKS_MODULE)
-	++state_val;
-#endif
+	if (IS_ENABLED(CONFIG_HID_SENSOR_ENUM_BASE_QUIRKS))
+		++state_val;
 	st->data_ready = state;
 	sensor_hub_set_feature(st->hsdev, st->power_state.report_id,
 					st->power_state.index,
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: hid-sensors: convert HID_SENSOR_ENUM_BASE_QUIRKS to bool
  2012-10-22  7:57 [PATCH] iio: hid-sensors: convert HID_SENSOR_ENUM_BASE_QUIRKS to bool Kirill A. Shutemov
@ 2012-10-31 10:35 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2012-10-31 10:35 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: srinivas pandruvada, Jonathan Cameron, linux-iio, linux-kernel

On 10/22/2012 08:57 AM, Kirill A. Shutemov wrote:
> From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> 
> It's non-sense to use tristate for the option, it's bool.
> 
Good point.

Applied to fixes-togreg branch of

git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git

Thanks,

Jonathan

> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> ---
>  drivers/iio/common/hid-sensors/Kconfig              |    2 +-
>  drivers/iio/common/hid-sensors/hid-sensor-trigger.c |    6 ++----
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/common/hid-sensors/Kconfig b/drivers/iio/common/hid-sensors/Kconfig
> index 8e63d81..ae10778 100644
> --- a/drivers/iio/common/hid-sensors/Kconfig
> +++ b/drivers/iio/common/hid-sensors/Kconfig
> @@ -15,7 +15,7 @@ config HID_SENSOR_IIO_COMMON
>  	  attributes.
>  
>  config HID_SENSOR_ENUM_BASE_QUIRKS
> -	tristate "ENUM base quirks for HID Sensor IIO drivers"
> +	bool "ENUM base quirks for HID Sensor IIO drivers"
>  	depends on HID_SENSOR_IIO_COMMON
>  	help
>  	  Say yes here to build support for sensor hub FW using
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> index d4b790d..d60198a 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> @@ -36,10 +36,8 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig,
>  	int state_val;
>  
>  	state_val = state ? 1 : 0;
> -#if (defined CONFIG_HID_SENSOR_ENUM_BASE_QUIRKS) || \
> -	(defined CONFIG_HID_SENSOR_ENUM_BASE_QUIRKS_MODULE)
> -	++state_val;
> -#endif
> +	if (IS_ENABLED(CONFIG_HID_SENSOR_ENUM_BASE_QUIRKS))
> +		++state_val;
>  	st->data_ready = state;
>  	sensor_hub_set_feature(st->hsdev, st->power_state.report_id,
>  					st->power_state.index,
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-31 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22  7:57 [PATCH] iio: hid-sensors: convert HID_SENSOR_ENUM_BASE_QUIRKS to bool Kirill A. Shutemov
2012-10-31 10:35 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).