Skip to contentSkip to conversation

iio: proximity: hx9023s: Use 'CLOCK_BOOTTIME' as the default clock source

PATCH In review Yasin Lee 2 participants 3 messages Sep 2, 2024 – Sep 4, 2024 IIO

lore
Share & tools
lore

Yasin Lee

author
#0 lore raw

PATCH 1/1 iio: proximity: hx9023s: Use 'CLOCK_BOOTTIME' as the default clock source

Override the default (CLOCK_REALTIME) clock source to 'CLOCK_BOOTTIME'.

---
 drivers/iio/proximity/hx9023s.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/iio/proximity/hx9023s.c +4 -0
index 8b9f84400e00..5363357a9a46 100644
@@ -1074,6 +1074,10 @@ static int hx9023s_probe(struct i2c_client *client)
 					     "iio trigger register failed\n");
 	}
 
+	ret = iio_device_set_clock(indio_dev, CLOCK_BOOTTIME);
+	if (ret)
+		return dev_err_probe(dev, ret, "clock boottime set failed\n");
+
 	ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
 					      iio_pollfunc_store_time,
 					      hx9023s_trigger_handler,
Signature · 1 line
2.43.0
#1 lore raw
Quoted 1 line · Yasin Lee

Override the default (CLOCK_REALTIME) clock source to 'CLOCK_BOOTTIME'.

Why? Won't this break existing applications that rely on the current default?

Quoted 21 lines
---
  drivers/iio/proximity/hx9023s.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/iio/proximity/hx9023s.c +4 -0
index 8b9f84400e00..5363357a9a46 100644
@@ -1074,6 +1074,10 @@ static int hx9023s_probe(struct i2c_client *client)
  					     "iio trigger register failed\n");
  	}
 
+	ret = iio_device_set_clock(indio_dev, CLOCK_BOOTTIME);
+	if (ret)
+		return dev_err_probe(dev, ret, "clock boottime set failed\n");
+
  	ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
  					      iio_pollfunc_store_time,
  					      hx9023s_trigger_handler,
author
#2 lore raw
Quoted 4 lines · Lars-Peter Clausen
Quoted 1 line · Yasin Lee

Override the default (CLOCK_REALTIME) clock source to 'CLOCK_BOOTTIME'.

Why? Won't this break existing applications that rely on the current default?

Dear Lars-Peter,

Thank you very much for your careful review. After careful consideration, I agree that changing the clock source from CLOCK_REALTIME to CLOCK_BOOTTIME was not the right approach.

This submission is incorrect and will be discarded.

Best regards,
Yasin Lee

Quoted 22 lines
Quoted 20 lines

---
  drivers/iio/proximity/hx9023s.c | 4 ++++

  1 file changed, 4 insertions(+)
drivers/iio/proximity/hx9023s.c +3 -0
index 8b9f84400e00..5363357a9a46 100644
@@ -1074,6 +1074,10 @@ static int hx9023s_probe(struct i2c_client 
 *client)
                            "iio trigger register failed\n");
       }
   +    ret = iio_device_set_clock(indio_dev, CLOCK_BOOTTIME);
+    if (ret)
+        return dev_err_probe(dev, ret, "clock boottime set failed\n");
+
       ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
                             iio_pollfunc_store_time,

                            hx9023s_trigger_handler,