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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230405212233.4167986-5-risca@dalakolonin.se>
Date:   Wed,  5 Apr 2023 23:22:30 +0200
From:   Patrik Dahlström <risca@...akolonin.se>
To:     linux-iio@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, letux-kernel@...nphoenux.org,
        kernel@...a-handheld.com, pgoudagunta@...dia.com,
        hns@...delico.com, jic23@...nel.org, lars@...afoo.de,
        linux-omap@...r.kernel.org,
        Patrik Dahlström <risca@...akolonin.se>
Subject: [PATCH v3 4/7] iio: adc: palmas: move eventX_enable into palmas_adc_event

It just makes more sense to have all information regarding adc events in
one place.

Signed-off-by: Patrik Dahlström <risca@...akolonin.se>
---
 drivers/iio/adc/palmas_gpadc.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c
index 205a7628b235..8c6ea4a3cd2e 100644
--- a/drivers/iio/adc/palmas_gpadc.c
+++ b/drivers/iio/adc/palmas_gpadc.c
@@ -77,6 +77,7 @@ static struct palmas_gpadc_info palmas_gpadc_info[] = {
 };
 
 struct palmas_adc_event {
+	bool enabled;
 	int channel;
 	int raw_thresh;
 	enum iio_event_direction direction;
@@ -119,8 +120,6 @@ struct palmas_gpadc {
 	struct completion		conv_completion;
 	struct palmas_adc_event		event0;
 	struct palmas_adc_event		event1;
-	bool				event0_enable;
-	bool				event1_enable;
 	int				auto_conversion_period;
 	struct mutex			lock;
 };
@@ -617,7 +616,7 @@ static int palmas_adc_configure_events(struct palmas_gpadc *adc)
 	}
 
 	conv = 0;
-	if (adc->event0_enable) {
+	if (adc->event0.enabled) {
 		struct palmas_adc_event *ev = &adc->event0;
 		int polarity;
 
@@ -653,7 +652,7 @@ static int palmas_adc_configure_events(struct palmas_gpadc *adc)
 		}
 	}
 
-	if (adc->event1_enable) {
+	if (adc->event1.enabled) {
 		struct palmas_adc_event *ev = &adc->event1;
 		int polarity;
 
@@ -728,7 +727,7 @@ static int palmas_gpadc_suspend(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct palmas_gpadc *adc = iio_priv(indio_dev);
-	int wakeup = adc->event0_enable || adc->event1_enable;
+	int wakeup = adc->event0.enabled || adc->event1.enabled;
 	int ret;
 
 	if (!device_may_wakeup(dev) || !wakeup)
@@ -738,10 +737,10 @@ static int palmas_gpadc_suspend(struct device *dev)
 	if (ret < 0)
 		return ret;
 
-	if (adc->event0_enable)
+	if (adc->event0.enabled)
 		enable_irq_wake(adc->irq_auto_0);
 
-	if (adc->event1_enable)
+	if (adc->event1.enabled)
 		enable_irq_wake(adc->irq_auto_1);
 
 	return 0;
@@ -751,7 +750,7 @@ static int palmas_gpadc_resume(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct palmas_gpadc *adc = iio_priv(indio_dev);
-	int wakeup = adc->event0_enable || adc->event1_enable;
+	int wakeup = adc->event0.enabled || adc->event1.enabled;
 	int ret;
 
 	if (!device_may_wakeup(dev) || !wakeup)
@@ -761,10 +760,10 @@ static int palmas_gpadc_resume(struct device *dev)
 	if (ret < 0)
 		return ret;
 
-	if (adc->event0_enable)
+	if (adc->event0.enabled)
 		disable_irq_wake(adc->irq_auto_0);
 
-	if (adc->event1_enable)
+	if (adc->event1.enabled)
 		disable_irq_wake(adc->irq_auto_1);
 
 	return 0;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ