public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 00/23] counter: cleanups and device lifetime fixes
@ 2021-12-27  9:45 Uwe Kleine-König
  2021-12-27  9:45 ` [PATCH v2 03/23] counter: microchip-tcb-capture: Drop unused platform_set_drvdata() Uwe Kleine-König
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Uwe Kleine-König @ 2021-12-27  9:45 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Patrick Havelange,
	Kamel Bouhara, linux-arm-kernel, Syed Nayyar Waris,
	Oleksij Rempel, Jarkko Nikula, David Lechner, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, Jonathan Corbet,
	linux-doc, Ahmad Fatoum, Felipe Balbi (Intel), Raymond Tan,
	Benjamin Gaignard

Hello,

this is v2 of this series, it's goal is to fix struct device lifetime issues as
pointed out in patch #13. The patches up to patch #12 are only prepatory and
cleanup patches. Patch #13 provides the needed functions to fix the issues in
all drivers (patches #15 to #22). The last patch removes the then unused API
calls.

The changes compared to v1 is only build fixes that I missed to include in v1,
they were only in my working copy. Additionally I changed:

diff --git a/drivers/counter/counter-core.c b/drivers/counter/counter-core.c
index cdc6004a7e77..3f7dc5718423 100644
--- a/drivers/counter/counter-core.c
+++ b/drivers/counter/counter-core.c
@@ -27,7 +27,7 @@ static DEFINE_IDA(counter_ida);
 
 struct counter_device_allochelper {
 	struct counter_device counter;
-	unsigned long privdata[0];
+	unsigned long privdata[];
 };
 
 static void counter_device_release(struct device *dev)

The stm32-timer-cnt driver was used to test
this series, the other drivers are only compile tested.


To complete the information from the v1 thread: There are a few more
issues I found while working on this patch set:

 - 104_QUAD_8 depends on X86, but compiles fine on ARCH=arm. Maybe
   adding support for COMPILE_TEST would be a good idea.

 - 104-quad-8.c uses devm_request_irq() and (now) devm_counter_add(). On
   unbind an irq might be pending which results in quad8_irq_handler()
   calling counter_push_event() for a counter that is already
   unregistered. (The issue exists also without my changes.)

 - I think intel-qep.c makes the counter unfunctional in
   intel_qep_remove before the counter is unregistered.

 - I wonder why counter is a bus and not a class device type. There is
   no driver that would ever bind a counter device, is there? So
   /sys/bus/counter/driver is always empty.

Do whatever you want with this list, I won't address these in the near
future.

Uwe Kleine-König (23):
  counter: Use container_of instead of drvdata to track counter_device
  counter: ftm-quaddec: Drop unused platform_set_drvdata()
  counter: microchip-tcb-capture: Drop unused platform_set_drvdata()
  counter: Provide a wrapper to access device private data
  counter: 104-quad-8: Convert to counter_priv() wrapper
  counter: interrupt-cnt: Convert to counter_priv() wrapper
  counter: microchip-tcb-capture: Convert to counter_priv() wrapper
  counter: intel-qep: Convert to counter_priv() wrapper
  counter: ftm-quaddec: Convert to counter_priv() wrapper
  counter: ti-eqep: Convert to counter_priv() wrapper
  counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper
  counter: stm32-timer-cnt: Convert to counter_priv() wrapper
  counter: Provide alternative counter registration functions
  counter: Update documentation for new counter registration functions
  counter: 104-quad-8: Convert to new counter registration
  counter: interrupt-cnt: Convert to new counter registration
  counter: intel-qep: Convert to new counter registration
  counter: ftm-quaddec: Convert to new counter registration
  counter: microchip-tcb-capture: Convert to new counter registration
  counter: stm32-timer-cnt: Convert to new counter registration
  counter: stm32-lptimer-cnt: Convert to new counter registration
  counter: ti-eqep: Convert to new counter registration
  counter: remove old and now unused registration API

 Documentation/driver-api/generic-counter.rst |  10 +-
 drivers/counter/104-quad-8.c                 |  93 +++++-----
 drivers/counter/counter-core.c               | 168 +++++++++++++------
 drivers/counter/ftm-quaddec.c                |  37 ++--
 drivers/counter/intel-qep.c                  |  46 ++---
 drivers/counter/interrupt-cnt.c              |  38 +++--
 drivers/counter/microchip-tcb-capture.c      |  44 ++---
 drivers/counter/stm32-lptimer-cnt.c          |  51 +++---
 drivers/counter/stm32-timer-cnt.c            |  48 +++---
 drivers/counter/ti-eqep.c                    |  47 +++---
 include/linux/counter.h                      |  15 +-
 11 files changed, 348 insertions(+), 249 deletions(-)


base-commit: a7904a538933c525096ca2ccde1e60d0ee62c08e
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 03/23] counter: microchip-tcb-capture: Drop unused platform_set_drvdata()
  2021-12-27  9:45 [PATCH v2 00/23] counter: cleanups and device lifetime fixes Uwe Kleine-König
@ 2021-12-27  9:45 ` Uwe Kleine-König
  2021-12-28 17:38   ` Jonathan Cameron
  2021-12-29  6:44   ` William Breathitt Gray
  2021-12-27  9:45 ` [PATCH v2 07/23] counter: microchip-tcb-capture: Convert to counter_priv() wrapper Uwe Kleine-König
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 22+ messages in thread
From: Uwe Kleine-König @ 2021-12-27  9:45 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Kamel Bouhara, linux-arm-kernel

The driver doesn't ever use platform_get_drvdata, so drop this unused
call.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/counter/microchip-tcb-capture.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
index 0ab1b2716784..bb69f2e0ba93 100644
--- a/drivers/counter/microchip-tcb-capture.c
+++ b/drivers/counter/microchip-tcb-capture.c
@@ -307,8 +307,6 @@ static int mchp_tc_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	platform_set_drvdata(pdev, priv);
-
 	match = of_match_node(atmel_tc_of_match, np->parent);
 	tcb_config = match->data;
 	if (!tcb_config) {
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 07/23] counter: microchip-tcb-capture: Convert to counter_priv() wrapper
  2021-12-27  9:45 [PATCH v2 00/23] counter: cleanups and device lifetime fixes Uwe Kleine-König
  2021-12-27  9:45 ` [PATCH v2 03/23] counter: microchip-tcb-capture: Drop unused platform_set_drvdata() Uwe Kleine-König
@ 2021-12-27  9:45 ` Uwe Kleine-König
  2021-12-28 18:05   ` Jonathan Cameron
  2021-12-29  7:35   ` William Breathitt Gray
  2021-12-27  9:45 ` [PATCH v2 11/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 22+ messages in thread
From: Uwe Kleine-König @ 2021-12-27  9:45 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Kamel Bouhara, linux-arm-kernel

This is a straight forward conversion to the new counter_priv() wrapper.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/counter/microchip-tcb-capture.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
index bb69f2e0ba93..1b56b7444668 100644
--- a/drivers/counter/microchip-tcb-capture.c
+++ b/drivers/counter/microchip-tcb-capture.c
@@ -72,7 +72,7 @@ static int mchp_tc_count_function_read(struct counter_device *counter,
 				       struct counter_count *count,
 				       enum counter_function *function)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 
 	if (priv->qdec_mode)
 		*function = COUNTER_FUNCTION_QUADRATURE_X4;
@@ -86,7 +86,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
 					struct counter_count *count,
 					enum counter_function function)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	u32 bmr, cmr;
 
 	regmap_read(priv->regmap, ATMEL_TC_BMR, &bmr);
@@ -148,7 +148,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter,
 				     struct counter_signal *signal,
 				     enum counter_signal_level *lvl)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	bool sigstatus;
 	u32 sr;
 
@@ -169,7 +169,7 @@ static int mchp_tc_count_action_read(struct counter_device *counter,
 				     struct counter_synapse *synapse,
 				     enum counter_synapse_action *action)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	u32 cmr;
 
 	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
@@ -197,7 +197,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
 				      struct counter_synapse *synapse,
 				      enum counter_synapse_action action)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	u32 edge = ATMEL_TC_ETRGEDG_NONE;
 
 	/* QDEC mode is rising edge only */
@@ -230,7 +230,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
 static int mchp_tc_count_read(struct counter_device *counter,
 			      struct counter_count *count, u64 *val)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	u32 cnt;
 
 	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CV), &cnt);
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 11/23] counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper
  2021-12-27  9:45 [PATCH v2 00/23] counter: cleanups and device lifetime fixes Uwe Kleine-König
  2021-12-27  9:45 ` [PATCH v2 03/23] counter: microchip-tcb-capture: Drop unused platform_set_drvdata() Uwe Kleine-König
  2021-12-27  9:45 ` [PATCH v2 07/23] counter: microchip-tcb-capture: Convert to counter_priv() wrapper Uwe Kleine-König
@ 2021-12-27  9:45 ` Uwe Kleine-König
  2021-12-28 18:08   ` Jonathan Cameron
  2021-12-29  7:48   ` William Breathitt Gray
  2021-12-27  9:45 ` [PATCH v2 12/23] counter: stm32-timer-cnt: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 22+ messages in thread
From: Uwe Kleine-König @ 2021-12-27  9:45 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, Benjamin Gaignard,
	linux-arm-kernel

This is a straight forward conversion to the new counter_priv() wrapper.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/counter/stm32-lptimer-cnt.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c
index 5168833b1fdf..9cf00e929cc0 100644
--- a/drivers/counter/stm32-lptimer-cnt.c
+++ b/drivers/counter/stm32-lptimer-cnt.c
@@ -141,7 +141,7 @@ static const enum counter_synapse_action stm32_lptim_cnt_synapse_actions[] = {
 static int stm32_lptim_cnt_read(struct counter_device *counter,
 				struct counter_count *count, u64 *val)
 {
-	struct stm32_lptim_cnt *const priv = counter->priv;
+	struct stm32_lptim_cnt *const priv = counter_priv(counter);
 	u32 cnt;
 	int ret;
 
@@ -158,7 +158,7 @@ static int stm32_lptim_cnt_function_read(struct counter_device *counter,
 					 struct counter_count *count,
 					 enum counter_function *function)
 {
-	struct stm32_lptim_cnt *const priv = counter->priv;
+	struct stm32_lptim_cnt *const priv = counter_priv(counter);
 
 	if (!priv->quadrature_mode) {
 		*function = COUNTER_FUNCTION_INCREASE;
@@ -177,7 +177,7 @@ static int stm32_lptim_cnt_function_write(struct counter_device *counter,
 					  struct counter_count *count,
 					  enum counter_function function)
 {
-	struct stm32_lptim_cnt *const priv = counter->priv;
+	struct stm32_lptim_cnt *const priv = counter_priv(counter);
 
 	if (stm32_lptim_is_enabled(priv))
 		return -EBUSY;
@@ -200,7 +200,7 @@ static int stm32_lptim_cnt_enable_read(struct counter_device *counter,
 				       struct counter_count *count,
 				       u8 *enable)
 {
-	struct stm32_lptim_cnt *const priv = counter->priv;
+	struct stm32_lptim_cnt *const priv = counter_priv(counter);
 	int ret;
 
 	ret = stm32_lptim_is_enabled(priv);
@@ -216,7 +216,7 @@ static int stm32_lptim_cnt_enable_write(struct counter_device *counter,
 					struct counter_count *count,
 					u8 enable)
 {
-	struct stm32_lptim_cnt *const priv = counter->priv;
+	struct stm32_lptim_cnt *const priv = counter_priv(counter);
 	int ret;
 
 	/* Check nobody uses the timer, or already disabled/enabled */
@@ -241,7 +241,7 @@ static int stm32_lptim_cnt_ceiling_read(struct counter_device *counter,
 					struct counter_count *count,
 					u64 *ceiling)
 {
-	struct stm32_lptim_cnt *const priv = counter->priv;
+	struct stm32_lptim_cnt *const priv = counter_priv(counter);
 
 	*ceiling = priv->ceiling;
 
@@ -252,7 +252,7 @@ static int stm32_lptim_cnt_ceiling_write(struct counter_device *counter,
 					 struct counter_count *count,
 					 u64 ceiling)
 {
-	struct stm32_lptim_cnt *const priv = counter->priv;
+	struct stm32_lptim_cnt *const priv = counter_priv(counter);
 
 	if (stm32_lptim_is_enabled(priv))
 		return -EBUSY;
@@ -277,7 +277,7 @@ static int stm32_lptim_cnt_action_read(struct counter_device *counter,
 				       struct counter_synapse *synapse,
 				       enum counter_synapse_action *action)
 {
-	struct stm32_lptim_cnt *const priv = counter->priv;
+	struct stm32_lptim_cnt *const priv = counter_priv(counter);
 	enum counter_function function;
 	int err;
 
@@ -321,7 +321,7 @@ static int stm32_lptim_cnt_action_write(struct counter_device *counter,
 					struct counter_synapse *synapse,
 					enum counter_synapse_action action)
 {
-	struct stm32_lptim_cnt *const priv = counter->priv;
+	struct stm32_lptim_cnt *const priv = counter_priv(counter);
 	enum counter_function function;
 	int err;
 
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 12/23] counter: stm32-timer-cnt: Convert to counter_priv() wrapper
  2021-12-27  9:45 [PATCH v2 00/23] counter: cleanups and device lifetime fixes Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2021-12-27  9:45 ` [PATCH v2 11/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
@ 2021-12-27  9:45 ` Uwe Kleine-König
  2021-12-28 18:08   ` Jonathan Cameron
  2021-12-29  7:48   ` William Breathitt Gray
  2021-12-27  9:45 ` [PATCH v2 20/23] counter: stm32-timer-cnt: Convert to new counter registration Uwe Kleine-König
                   ` (2 subsequent siblings)
  6 siblings, 2 replies; 22+ messages in thread
From: Uwe Kleine-König @ 2021-12-27  9:45 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, Benjamin Gaignard,
	linux-arm-kernel

This is a straight forward conversion to the new counter_priv() wrapper.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/counter/stm32-timer-cnt.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
index 0546e932db0c..4b05b198a8d8 100644
--- a/drivers/counter/stm32-timer-cnt.c
+++ b/drivers/counter/stm32-timer-cnt.c
@@ -47,7 +47,7 @@ static const enum counter_function stm32_count_functions[] = {
 static int stm32_count_read(struct counter_device *counter,
 			    struct counter_count *count, u64 *val)
 {
-	struct stm32_timer_cnt *const priv = counter->priv;
+	struct stm32_timer_cnt *const priv = counter_priv(counter);
 	u32 cnt;
 
 	regmap_read(priv->regmap, TIM_CNT, &cnt);
@@ -59,7 +59,7 @@ static int stm32_count_read(struct counter_device *counter,
 static int stm32_count_write(struct counter_device *counter,
 			     struct counter_count *count, const u64 val)
 {
-	struct stm32_timer_cnt *const priv = counter->priv;
+	struct stm32_timer_cnt *const priv = counter_priv(counter);
 	u32 ceiling;
 
 	regmap_read(priv->regmap, TIM_ARR, &ceiling);
@@ -73,7 +73,7 @@ static int stm32_count_function_read(struct counter_device *counter,
 				     struct counter_count *count,
 				     enum counter_function *function)
 {
-	struct stm32_timer_cnt *const priv = counter->priv;
+	struct stm32_timer_cnt *const priv = counter_priv(counter);
 	u32 smcr;
 
 	regmap_read(priv->regmap, TIM_SMCR, &smcr);
@@ -100,7 +100,7 @@ static int stm32_count_function_write(struct counter_device *counter,
 				      struct counter_count *count,
 				      enum counter_function function)
 {
-	struct stm32_timer_cnt *const priv = counter->priv;
+	struct stm32_timer_cnt *const priv = counter_priv(counter);
 	u32 cr1, sms;
 
 	switch (function) {
@@ -140,7 +140,7 @@ static int stm32_count_direction_read(struct counter_device *counter,
 				      struct counter_count *count,
 				      enum counter_count_direction *direction)
 {
-	struct stm32_timer_cnt *const priv = counter->priv;
+	struct stm32_timer_cnt *const priv = counter_priv(counter);
 	u32 cr1;
 
 	regmap_read(priv->regmap, TIM_CR1, &cr1);
@@ -153,7 +153,7 @@ static int stm32_count_direction_read(struct counter_device *counter,
 static int stm32_count_ceiling_read(struct counter_device *counter,
 				    struct counter_count *count, u64 *ceiling)
 {
-	struct stm32_timer_cnt *const priv = counter->priv;
+	struct stm32_timer_cnt *const priv = counter_priv(counter);
 	u32 arr;
 
 	regmap_read(priv->regmap, TIM_ARR, &arr);
@@ -166,7 +166,7 @@ static int stm32_count_ceiling_read(struct counter_device *counter,
 static int stm32_count_ceiling_write(struct counter_device *counter,
 				     struct counter_count *count, u64 ceiling)
 {
-	struct stm32_timer_cnt *const priv = counter->priv;
+	struct stm32_timer_cnt *const priv = counter_priv(counter);
 
 	if (ceiling > priv->max_arr)
 		return -ERANGE;
@@ -181,7 +181,7 @@ static int stm32_count_ceiling_write(struct counter_device *counter,
 static int stm32_count_enable_read(struct counter_device *counter,
 				   struct counter_count *count, u8 *enable)
 {
-	struct stm32_timer_cnt *const priv = counter->priv;
+	struct stm32_timer_cnt *const priv = counter_priv(counter);
 	u32 cr1;
 
 	regmap_read(priv->regmap, TIM_CR1, &cr1);
@@ -194,7 +194,7 @@ static int stm32_count_enable_read(struct counter_device *counter,
 static int stm32_count_enable_write(struct counter_device *counter,
 				    struct counter_count *count, u8 enable)
 {
-	struct stm32_timer_cnt *const priv = counter->priv;
+	struct stm32_timer_cnt *const priv = counter_priv(counter);
 	u32 cr1;
 
 	if (enable) {
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 20/23] counter: stm32-timer-cnt: Convert to new counter registration
  2021-12-27  9:45 [PATCH v2 00/23] counter: cleanups and device lifetime fixes Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2021-12-27  9:45 ` [PATCH v2 12/23] counter: stm32-timer-cnt: " Uwe Kleine-König
@ 2021-12-27  9:45 ` Uwe Kleine-König
  2021-12-28 18:25   ` Jonathan Cameron
  2021-12-29  8:37   ` William Breathitt Gray
  2021-12-27  9:45 ` [PATCH v2 21/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
  2021-12-27 12:25 ` [PATCH v2 00/23] counter: cleanups and device lifetime fixes Lars-Peter Clausen
  6 siblings, 2 replies; 22+ messages in thread
From: Uwe Kleine-König @ 2021-12-27  9:45 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, Benjamin Gaignard, linux-stm32,
	linux-arm-kernel

This fixes device lifetime issues where it was possible to free a live
struct device.

Fixes: ad29937e206f ("counter: Add STM32 Timer quadrature encoder")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/counter/stm32-timer-cnt.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
index 4b05b198a8d8..5779ae7c73cf 100644
--- a/drivers/counter/stm32-timer-cnt.c
+++ b/drivers/counter/stm32-timer-cnt.c
@@ -29,7 +29,6 @@ struct stm32_timer_regs {
 };
 
 struct stm32_timer_cnt {
-	struct counter_device counter;
 	struct regmap *regmap;
 	struct clk *clk;
 	u32 max_arr;
@@ -317,31 +316,38 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev)
 	struct stm32_timers *ddata = dev_get_drvdata(pdev->dev.parent);
 	struct device *dev = &pdev->dev;
 	struct stm32_timer_cnt *priv;
+	struct counter_device *counter;
+	int ret;
 
 	if (IS_ERR_OR_NULL(ddata))
 		return -EINVAL;
 
-	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv)
+	counter = devm_counter_alloc(dev, sizeof(*priv));
+	if (!counter)
 		return -ENOMEM;
 
+	priv = counter_priv(counter);
+
 	priv->regmap = ddata->regmap;
 	priv->clk = ddata->clk;
 	priv->max_arr = ddata->max_arr;
 
-	priv->counter.name = dev_name(dev);
-	priv->counter.parent = dev;
-	priv->counter.ops = &stm32_timer_cnt_ops;
-	priv->counter.counts = &stm32_counts;
-	priv->counter.num_counts = 1;
-	priv->counter.signals = stm32_signals;
-	priv->counter.num_signals = ARRAY_SIZE(stm32_signals);
-	priv->counter.priv = priv;
+	counter->name = dev_name(dev);
+	counter->parent = dev;
+	counter->ops = &stm32_timer_cnt_ops;
+	counter->counts = &stm32_counts;
+	counter->num_counts = 1;
+	counter->signals = stm32_signals;
+	counter->num_signals = ARRAY_SIZE(stm32_signals);
 
 	platform_set_drvdata(pdev, priv);
 
 	/* Register Counter device */
-	return devm_counter_register(dev, &priv->counter);
+	ret = devm_counter_add(dev, counter);
+	if (ret < 0)
+		dev_err_probe(dev, ret, "Failed to add counter\n");
+
+	return ret;
 }
 
 static int __maybe_unused stm32_timer_cnt_suspend(struct device *dev)
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 21/23] counter: stm32-lptimer-cnt: Convert to new counter registration
  2021-12-27  9:45 [PATCH v2 00/23] counter: cleanups and device lifetime fixes Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2021-12-27  9:45 ` [PATCH v2 20/23] counter: stm32-timer-cnt: Convert to new counter registration Uwe Kleine-König
@ 2021-12-27  9:45 ` Uwe Kleine-König
  2021-12-28 18:26   ` Jonathan Cameron
  2021-12-29  8:39   ` William Breathitt Gray
  2021-12-27 12:25 ` [PATCH v2 00/23] counter: cleanups and device lifetime fixes Lars-Peter Clausen
  6 siblings, 2 replies; 22+ messages in thread
From: Uwe Kleine-König @ 2021-12-27  9:45 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, Benjamin Gaignard, linux-stm32,
	linux-arm-kernel

This fixes device lifetime issues where it was possible to free a live
struct device.

Fixes: 597f55e3f36c ("counter: stm32-lptimer: add counter device")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/counter/stm32-lptimer-cnt.c | 33 +++++++++++++++++------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c
index 9cf00e929cc0..68031d93ce89 100644
--- a/drivers/counter/stm32-lptimer-cnt.c
+++ b/drivers/counter/stm32-lptimer-cnt.c
@@ -20,7 +20,6 @@
 #include <linux/types.h>
 
 struct stm32_lptim_cnt {
-	struct counter_device counter;
 	struct device *dev;
 	struct regmap *regmap;
 	struct clk *clk;
@@ -411,14 +410,17 @@ static struct counter_count stm32_lptim_in1_counts = {
 static int stm32_lptim_cnt_probe(struct platform_device *pdev)
 {
 	struct stm32_lptimer *ddata = dev_get_drvdata(pdev->dev.parent);
+	struct counter_device *counter;
 	struct stm32_lptim_cnt *priv;
+	int ret;
 
 	if (IS_ERR_OR_NULL(ddata))
 		return -EINVAL;
 
-	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv)
+	counter = devm_counter_alloc(&pdev->dev, sizeof(*priv));
+	if (!counter)
 		return -ENOMEM;
+	priv = counter_priv(counter);
 
 	priv->dev = &pdev->dev;
 	priv->regmap = ddata->regmap;
@@ -426,23 +428,26 @@ static int stm32_lptim_cnt_probe(struct platform_device *pdev)
 	priv->ceiling = STM32_LPTIM_MAX_ARR;
 
 	/* Initialize Counter device */
-	priv->counter.name = dev_name(&pdev->dev);
-	priv->counter.parent = &pdev->dev;
-	priv->counter.ops = &stm32_lptim_cnt_ops;
+	counter->name = dev_name(&pdev->dev);
+	counter->parent = &pdev->dev;
+	counter->ops = &stm32_lptim_cnt_ops;
 	if (ddata->has_encoder) {
-		priv->counter.counts = &stm32_lptim_enc_counts;
-		priv->counter.num_signals = ARRAY_SIZE(stm32_lptim_cnt_signals);
+		counter->counts = &stm32_lptim_enc_counts;
+		counter->num_signals = ARRAY_SIZE(stm32_lptim_cnt_signals);
 	} else {
-		priv->counter.counts = &stm32_lptim_in1_counts;
-		priv->counter.num_signals = 1;
+		counter->counts = &stm32_lptim_in1_counts;
+		counter->num_signals = 1;
 	}
-	priv->counter.num_counts = 1;
-	priv->counter.signals = stm32_lptim_cnt_signals;
-	priv->counter.priv = priv;
+	counter->num_counts = 1;
+	counter->signals = stm32_lptim_cnt_signals;
 
 	platform_set_drvdata(pdev, priv);
 
-	return devm_counter_register(&pdev->dev, &priv->counter);
+	ret = devm_counter_add(&pdev->dev, counter);
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret, "Failed to add counter\n");
+
+	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 00/23] counter: cleanups and device lifetime fixes
  2021-12-27  9:45 [PATCH v2 00/23] counter: cleanups and device lifetime fixes Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2021-12-27  9:45 ` [PATCH v2 21/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
@ 2021-12-27 12:25 ` Lars-Peter Clausen
  2021-12-28 17:35   ` Jonathan Cameron
  6 siblings, 1 reply; 22+ messages in thread
From: Lars-Peter Clausen @ 2021-12-27 12:25 UTC (permalink / raw)
  To: Uwe Kleine-König, William Breathitt Gray
  Cc: kernel, Jonathan Cameron, linux-iio, Greg Kroah-Hartman,
	linux-kernel, Patrick Havelange, Kamel Bouhara, linux-arm-kernel,
	Syed Nayyar Waris, Oleksij Rempel, Jarkko Nikula, David Lechner,
	Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue, linux-stm32,
	Jonathan Corbet, linux-doc, Ahmad Fatoum, Felipe Balbi (Intel),
	Raymond Tan, Benjamin Gaignard

On 12/27/21 10:45 AM, Uwe Kleine-König wrote:
> [...]
>
>   - I wonder why counter is a bus and not a class device type. There is
>     no driver that would ever bind a counter device, is there? So
>     /sys/bus/counter/driver is always empty.
>
There used to be a time when GKH said that we do not want new driver 
classes. And all new subsystems should use bus since bus is a superset 
of class. This restriction has been eased since then.

But it was around when the IIO subsystem was merged and since the 
counter subsystem originated from the IIO subsystem I assume it just 
copied this.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 00/23] counter: cleanups and device lifetime fixes
  2021-12-27 12:25 ` [PATCH v2 00/23] counter: cleanups and device lifetime fixes Lars-Peter Clausen
@ 2021-12-28 17:35   ` Jonathan Cameron
  2021-12-29  8:49     ` William Breathitt Gray
  0 siblings, 1 reply; 22+ messages in thread
From: Jonathan Cameron @ 2021-12-28 17:35 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Uwe Kleine-König, William Breathitt Gray, kernel,
	Jonathan Cameron, linux-iio, Greg Kroah-Hartman, linux-kernel,
	Patrick Havelange, Kamel Bouhara, linux-arm-kernel,
	Syed Nayyar Waris, Oleksij Rempel, Jarkko Nikula, David Lechner,
	Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue, linux-stm32,
	Jonathan Corbet, linux-doc, Ahmad Fatoum, Felipe Balbi (Intel),
	Raymond Tan, Benjamin Gaignard

On Mon, 27 Dec 2021 13:25:25 +0100
Lars-Peter Clausen <lars@metafoo.de> wrote:

> On 12/27/21 10:45 AM, Uwe Kleine-König wrote:
> > [...]
> >
> >   - I wonder why counter is a bus and not a class device type. There is
> >     no driver that would ever bind a counter device, is there? So
> >     /sys/bus/counter/driver is always empty.
> >  
> There used to be a time when GKH said that we do not want new driver 
> classes. And all new subsystems should use bus since bus is a superset 
> of class. This restriction has been eased since then.
> 
> But it was around when the IIO subsystem was merged and since the 
> counter subsystem originated from the IIO subsystem I assume it just 
> copied this.
> 

Yup. Discussion about this back then with one view being there
should never have been class in the first place.

https://lore.kernel.org/lkml/4B571DA4.6070603@cam.ac.uk/

For anyone who loves the history of these things...

FWIW I think Greg suggested IIO should be a bus because we were hanging
a bunch of different types of device off a class and it was getting messy.
Kay then gave some history on class vs bus and suggested no new
subsystem should use class.

Ah well, opinions change over time!

Also interesting to see we were discussing a bridge to input all that
time ago and it's still not gone beyond various prototypes (with
exception of touch screens).

Jonathan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 03/23] counter: microchip-tcb-capture: Drop unused platform_set_drvdata()
  2021-12-27  9:45 ` [PATCH v2 03/23] counter: microchip-tcb-capture: Drop unused platform_set_drvdata() Uwe Kleine-König
@ 2021-12-28 17:38   ` Jonathan Cameron
  2021-12-29  6:44   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: Jonathan Cameron @ 2021-12-28 17:38 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: William Breathitt Gray, Lars-Peter Clausen, kernel,
	Jonathan Cameron, linux-iio, Greg Kroah-Hartman, linux-kernel,
	Kamel Bouhara, linux-arm-kernel

On Mon, 27 Dec 2021 10:45:06 +0100
Uwe Kleine-König         <u.kleine-koenig@pengutronix.de> wrote:

> The driver doesn't ever use platform_get_drvdata, so drop this unused
> call.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
FWIW sanity checked it is indeed not used that I can see.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/counter/microchip-tcb-capture.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
> index 0ab1b2716784..bb69f2e0ba93 100644
> --- a/drivers/counter/microchip-tcb-capture.c
> +++ b/drivers/counter/microchip-tcb-capture.c
> @@ -307,8 +307,6 @@ static int mchp_tc_probe(struct platform_device *pdev)
>  	if (!priv)
>  		return -ENOMEM;
>  
> -	platform_set_drvdata(pdev, priv);
> -
>  	match = of_match_node(atmel_tc_of_match, np->parent);
>  	tcb_config = match->data;
>  	if (!tcb_config) {


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 07/23] counter: microchip-tcb-capture: Convert to counter_priv() wrapper
  2021-12-27  9:45 ` [PATCH v2 07/23] counter: microchip-tcb-capture: Convert to counter_priv() wrapper Uwe Kleine-König
@ 2021-12-28 18:05   ` Jonathan Cameron
  2021-12-29  7:35   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: Jonathan Cameron @ 2021-12-28 18:05 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: William Breathitt Gray, Lars-Peter Clausen, kernel,
	Jonathan Cameron, linux-iio, Greg Kroah-Hartman, linux-kernel,
	Kamel Bouhara, linux-arm-kernel

On Mon, 27 Dec 2021 10:45:10 +0100
Uwe Kleine-König         <u.kleine-koenig@pengutronix.de> wrote:

> This is a straight forward conversion to the new counter_priv() wrapper.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
(doing these individually in case your use b4 to pick up tags
as I don't think it can interpret a tag for last N patches :)


> ---
>  drivers/counter/microchip-tcb-capture.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
> index bb69f2e0ba93..1b56b7444668 100644
> --- a/drivers/counter/microchip-tcb-capture.c
> +++ b/drivers/counter/microchip-tcb-capture.c
> @@ -72,7 +72,7 @@ static int mchp_tc_count_function_read(struct counter_device *counter,
>  				       struct counter_count *count,
>  				       enum counter_function *function)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  
>  	if (priv->qdec_mode)
>  		*function = COUNTER_FUNCTION_QUADRATURE_X4;
> @@ -86,7 +86,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
>  					struct counter_count *count,
>  					enum counter_function function)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 bmr, cmr;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_BMR, &bmr);
> @@ -148,7 +148,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter,
>  				     struct counter_signal *signal,
>  				     enum counter_signal_level *lvl)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	bool sigstatus;
>  	u32 sr;
>  
> @@ -169,7 +169,7 @@ static int mchp_tc_count_action_read(struct counter_device *counter,
>  				     struct counter_synapse *synapse,
>  				     enum counter_synapse_action *action)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 cmr;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
> @@ -197,7 +197,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
>  				      struct counter_synapse *synapse,
>  				      enum counter_synapse_action action)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 edge = ATMEL_TC_ETRGEDG_NONE;
>  
>  	/* QDEC mode is rising edge only */
> @@ -230,7 +230,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
>  static int mchp_tc_count_read(struct counter_device *counter,
>  			      struct counter_count *count, u64 *val)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 cnt;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CV), &cnt);


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 11/23] counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper
  2021-12-27  9:45 ` [PATCH v2 11/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
@ 2021-12-28 18:08   ` Jonathan Cameron
  2021-12-29  7:48   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: Jonathan Cameron @ 2021-12-28 18:08 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: William Breathitt Gray, Lars-Peter Clausen, kernel,
	Jonathan Cameron, linux-iio, Greg Kroah-Hartman, linux-kernel,
	Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue, linux-stm32,
	Benjamin Gaignard, linux-arm-kernel

On Mon, 27 Dec 2021 10:45:14 +0100
Uwe Kleine-König         <u.kleine-koenig@pengutronix.de> wrote:

> This is a straight forward conversion to the new counter_priv() wrapper.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/counter/stm32-lptimer-cnt.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c
> index 5168833b1fdf..9cf00e929cc0 100644
> --- a/drivers/counter/stm32-lptimer-cnt.c
> +++ b/drivers/counter/stm32-lptimer-cnt.c
> @@ -141,7 +141,7 @@ static const enum counter_synapse_action stm32_lptim_cnt_synapse_actions[] = {
>  static int stm32_lptim_cnt_read(struct counter_device *counter,
>  				struct counter_count *count, u64 *val)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	u32 cnt;
>  	int ret;
>  
> @@ -158,7 +158,7 @@ static int stm32_lptim_cnt_function_read(struct counter_device *counter,
>  					 struct counter_count *count,
>  					 enum counter_function *function)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  
>  	if (!priv->quadrature_mode) {
>  		*function = COUNTER_FUNCTION_INCREASE;
> @@ -177,7 +177,7 @@ static int stm32_lptim_cnt_function_write(struct counter_device *counter,
>  					  struct counter_count *count,
>  					  enum counter_function function)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  
>  	if (stm32_lptim_is_enabled(priv))
>  		return -EBUSY;
> @@ -200,7 +200,7 @@ static int stm32_lptim_cnt_enable_read(struct counter_device *counter,
>  				       struct counter_count *count,
>  				       u8 *enable)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	int ret;
>  
>  	ret = stm32_lptim_is_enabled(priv);
> @@ -216,7 +216,7 @@ static int stm32_lptim_cnt_enable_write(struct counter_device *counter,
>  					struct counter_count *count,
>  					u8 enable)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	int ret;
>  
>  	/* Check nobody uses the timer, or already disabled/enabled */
> @@ -241,7 +241,7 @@ static int stm32_lptim_cnt_ceiling_read(struct counter_device *counter,
>  					struct counter_count *count,
>  					u64 *ceiling)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  
>  	*ceiling = priv->ceiling;
>  
> @@ -252,7 +252,7 @@ static int stm32_lptim_cnt_ceiling_write(struct counter_device *counter,
>  					 struct counter_count *count,
>  					 u64 ceiling)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  
>  	if (stm32_lptim_is_enabled(priv))
>  		return -EBUSY;
> @@ -277,7 +277,7 @@ static int stm32_lptim_cnt_action_read(struct counter_device *counter,
>  				       struct counter_synapse *synapse,
>  				       enum counter_synapse_action *action)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	enum counter_function function;
>  	int err;
>  
> @@ -321,7 +321,7 @@ static int stm32_lptim_cnt_action_write(struct counter_device *counter,
>  					struct counter_synapse *synapse,
>  					enum counter_synapse_action action)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	enum counter_function function;
>  	int err;
>  


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 12/23] counter: stm32-timer-cnt: Convert to counter_priv() wrapper
  2021-12-27  9:45 ` [PATCH v2 12/23] counter: stm32-timer-cnt: " Uwe Kleine-König
@ 2021-12-28 18:08   ` Jonathan Cameron
  2021-12-29  7:48   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: Jonathan Cameron @ 2021-12-28 18:08 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: William Breathitt Gray, Lars-Peter Clausen, kernel,
	Jonathan Cameron, linux-iio, Greg Kroah-Hartman, linux-kernel,
	Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue, linux-stm32,
	Benjamin Gaignard, linux-arm-kernel

On Mon, 27 Dec 2021 10:45:15 +0100
Uwe Kleine-König         <u.kleine-koenig@pengutronix.de> wrote:

> This is a straight forward conversion to the new counter_priv() wrapper.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/counter/stm32-timer-cnt.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
> index 0546e932db0c..4b05b198a8d8 100644
> --- a/drivers/counter/stm32-timer-cnt.c
> +++ b/drivers/counter/stm32-timer-cnt.c
> @@ -47,7 +47,7 @@ static const enum counter_function stm32_count_functions[] = {
>  static int stm32_count_read(struct counter_device *counter,
>  			    struct counter_count *count, u64 *val)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cnt;
>  
>  	regmap_read(priv->regmap, TIM_CNT, &cnt);
> @@ -59,7 +59,7 @@ static int stm32_count_read(struct counter_device *counter,
>  static int stm32_count_write(struct counter_device *counter,
>  			     struct counter_count *count, const u64 val)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 ceiling;
>  
>  	regmap_read(priv->regmap, TIM_ARR, &ceiling);
> @@ -73,7 +73,7 @@ static int stm32_count_function_read(struct counter_device *counter,
>  				     struct counter_count *count,
>  				     enum counter_function *function)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 smcr;
>  
>  	regmap_read(priv->regmap, TIM_SMCR, &smcr);
> @@ -100,7 +100,7 @@ static int stm32_count_function_write(struct counter_device *counter,
>  				      struct counter_count *count,
>  				      enum counter_function function)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cr1, sms;
>  
>  	switch (function) {
> @@ -140,7 +140,7 @@ static int stm32_count_direction_read(struct counter_device *counter,
>  				      struct counter_count *count,
>  				      enum counter_count_direction *direction)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cr1;
>  
>  	regmap_read(priv->regmap, TIM_CR1, &cr1);
> @@ -153,7 +153,7 @@ static int stm32_count_direction_read(struct counter_device *counter,
>  static int stm32_count_ceiling_read(struct counter_device *counter,
>  				    struct counter_count *count, u64 *ceiling)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 arr;
>  
>  	regmap_read(priv->regmap, TIM_ARR, &arr);
> @@ -166,7 +166,7 @@ static int stm32_count_ceiling_read(struct counter_device *counter,
>  static int stm32_count_ceiling_write(struct counter_device *counter,
>  				     struct counter_count *count, u64 ceiling)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  
>  	if (ceiling > priv->max_arr)
>  		return -ERANGE;
> @@ -181,7 +181,7 @@ static int stm32_count_ceiling_write(struct counter_device *counter,
>  static int stm32_count_enable_read(struct counter_device *counter,
>  				   struct counter_count *count, u8 *enable)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cr1;
>  
>  	regmap_read(priv->regmap, TIM_CR1, &cr1);
> @@ -194,7 +194,7 @@ static int stm32_count_enable_read(struct counter_device *counter,
>  static int stm32_count_enable_write(struct counter_device *counter,
>  				    struct counter_count *count, u8 enable)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cr1;
>  
>  	if (enable) {


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 20/23] counter: stm32-timer-cnt: Convert to new counter registration
  2021-12-27  9:45 ` [PATCH v2 20/23] counter: stm32-timer-cnt: Convert to new counter registration Uwe Kleine-König
@ 2021-12-28 18:25   ` Jonathan Cameron
  2021-12-29  8:37   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: Jonathan Cameron @ 2021-12-28 18:25 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: William Breathitt Gray, Lars-Peter Clausen, kernel,
	Jonathan Cameron, linux-iio, Greg Kroah-Hartman, linux-kernel,
	Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue,
	Benjamin Gaignard, linux-stm32, linux-arm-kernel

On Mon, 27 Dec 2021 10:45:23 +0100
Uwe Kleine-König         <u.kleine-koenig@pengutronix.de> wrote:

> This fixes device lifetime issues where it was possible to free a live
> struct device.
> 
> Fixes: ad29937e206f ("counter: Add STM32 Timer quadrature encoder")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Same basic form as all the others so easy to review (hopefully :)

Jonathan

> ---
>  drivers/counter/stm32-timer-cnt.c | 30 ++++++++++++++++++------------
>  1 file changed, 18 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
> index 4b05b198a8d8..5779ae7c73cf 100644
> --- a/drivers/counter/stm32-timer-cnt.c
> +++ b/drivers/counter/stm32-timer-cnt.c
> @@ -29,7 +29,6 @@ struct stm32_timer_regs {
>  };
>  
>  struct stm32_timer_cnt {
> -	struct counter_device counter;
>  	struct regmap *regmap;
>  	struct clk *clk;
>  	u32 max_arr;
> @@ -317,31 +316,38 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev)
>  	struct stm32_timers *ddata = dev_get_drvdata(pdev->dev.parent);
>  	struct device *dev = &pdev->dev;
>  	struct stm32_timer_cnt *priv;
> +	struct counter_device *counter;
> +	int ret;
>  
>  	if (IS_ERR_OR_NULL(ddata))
>  		return -EINVAL;
>  
> -	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> -	if (!priv)
> +	counter = devm_counter_alloc(dev, sizeof(*priv));
> +	if (!counter)
>  		return -ENOMEM;
>  
> +	priv = counter_priv(counter);
> +
>  	priv->regmap = ddata->regmap;
>  	priv->clk = ddata->clk;
>  	priv->max_arr = ddata->max_arr;
>  
> -	priv->counter.name = dev_name(dev);
> -	priv->counter.parent = dev;
> -	priv->counter.ops = &stm32_timer_cnt_ops;
> -	priv->counter.counts = &stm32_counts;
> -	priv->counter.num_counts = 1;
> -	priv->counter.signals = stm32_signals;
> -	priv->counter.num_signals = ARRAY_SIZE(stm32_signals);
> -	priv->counter.priv = priv;
> +	counter->name = dev_name(dev);
> +	counter->parent = dev;
> +	counter->ops = &stm32_timer_cnt_ops;
> +	counter->counts = &stm32_counts;
> +	counter->num_counts = 1;
> +	counter->signals = stm32_signals;
> +	counter->num_signals = ARRAY_SIZE(stm32_signals);
>  
>  	platform_set_drvdata(pdev, priv);
>  
>  	/* Register Counter device */
> -	return devm_counter_register(dev, &priv->counter);
> +	ret = devm_counter_add(dev, counter);
> +	if (ret < 0)
> +		dev_err_probe(dev, ret, "Failed to add counter\n");
> +
> +	return ret;
>  }
>  
>  static int __maybe_unused stm32_timer_cnt_suspend(struct device *dev)


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 21/23] counter: stm32-lptimer-cnt: Convert to new counter registration
  2021-12-27  9:45 ` [PATCH v2 21/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
@ 2021-12-28 18:26   ` Jonathan Cameron
  2021-12-29  8:39   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: Jonathan Cameron @ 2021-12-28 18:26 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: William Breathitt Gray, Lars-Peter Clausen, kernel,
	Jonathan Cameron, linux-iio, Greg Kroah-Hartman, linux-kernel,
	Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue,
	Benjamin Gaignard, linux-stm32, linux-arm-kernel

On Mon, 27 Dec 2021 10:45:24 +0100
Uwe Kleine-König         <u.kleine-koenig@pengutronix.de> wrote:

> This fixes device lifetime issues where it was possible to free a live
> struct device.
> 
> Fixes: 597f55e3f36c ("counter: stm32-lptimer: add counter device")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/counter/stm32-lptimer-cnt.c | 33 +++++++++++++++++------------
>  1 file changed, 19 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c
> index 9cf00e929cc0..68031d93ce89 100644
> --- a/drivers/counter/stm32-lptimer-cnt.c
> +++ b/drivers/counter/stm32-lptimer-cnt.c
> @@ -20,7 +20,6 @@
>  #include <linux/types.h>
>  
>  struct stm32_lptim_cnt {
> -	struct counter_device counter;
>  	struct device *dev;
>  	struct regmap *regmap;
>  	struct clk *clk;
> @@ -411,14 +410,17 @@ static struct counter_count stm32_lptim_in1_counts = {
>  static int stm32_lptim_cnt_probe(struct platform_device *pdev)
>  {
>  	struct stm32_lptimer *ddata = dev_get_drvdata(pdev->dev.parent);
> +	struct counter_device *counter;
>  	struct stm32_lptim_cnt *priv;
> +	int ret;
>  
>  	if (IS_ERR_OR_NULL(ddata))
>  		return -EINVAL;
>  
> -	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> -	if (!priv)
> +	counter = devm_counter_alloc(&pdev->dev, sizeof(*priv));
> +	if (!counter)
>  		return -ENOMEM;
> +	priv = counter_priv(counter);
>  
>  	priv->dev = &pdev->dev;
>  	priv->regmap = ddata->regmap;
> @@ -426,23 +428,26 @@ static int stm32_lptim_cnt_probe(struct platform_device *pdev)
>  	priv->ceiling = STM32_LPTIM_MAX_ARR;
>  
>  	/* Initialize Counter device */
> -	priv->counter.name = dev_name(&pdev->dev);
> -	priv->counter.parent = &pdev->dev;
> -	priv->counter.ops = &stm32_lptim_cnt_ops;
> +	counter->name = dev_name(&pdev->dev);
> +	counter->parent = &pdev->dev;
> +	counter->ops = &stm32_lptim_cnt_ops;
>  	if (ddata->has_encoder) {
> -		priv->counter.counts = &stm32_lptim_enc_counts;
> -		priv->counter.num_signals = ARRAY_SIZE(stm32_lptim_cnt_signals);
> +		counter->counts = &stm32_lptim_enc_counts;
> +		counter->num_signals = ARRAY_SIZE(stm32_lptim_cnt_signals);
>  	} else {
> -		priv->counter.counts = &stm32_lptim_in1_counts;
> -		priv->counter.num_signals = 1;
> +		counter->counts = &stm32_lptim_in1_counts;
> +		counter->num_signals = 1;
>  	}
> -	priv->counter.num_counts = 1;
> -	priv->counter.signals = stm32_lptim_cnt_signals;
> -	priv->counter.priv = priv;
> +	counter->num_counts = 1;
> +	counter->signals = stm32_lptim_cnt_signals;
>  
>  	platform_set_drvdata(pdev, priv);
>  
> -	return devm_counter_register(&pdev->dev, &priv->counter);
> +	ret = devm_counter_add(&pdev->dev, counter);
> +	if (ret < 0)
> +		return dev_err_probe(&pdev->dev, ret, "Failed to add counter\n");
> +
> +	return 0;
>  }
>  
>  #ifdef CONFIG_PM_SLEEP


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 03/23] counter: microchip-tcb-capture: Drop unused platform_set_drvdata()
  2021-12-27  9:45 ` [PATCH v2 03/23] counter: microchip-tcb-capture: Drop unused platform_set_drvdata() Uwe Kleine-König
  2021-12-28 17:38   ` Jonathan Cameron
@ 2021-12-29  6:44   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: William Breathitt Gray @ 2021-12-29  6:44 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Kamel Bouhara, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 922 bytes --]

On Mon, Dec 27, 2021 at 10:45:06AM +0100, Uwe Kleine-König wrote:
> The driver doesn't ever use platform_get_drvdata, so drop this unused
> call.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>

> ---
>  drivers/counter/microchip-tcb-capture.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
> index 0ab1b2716784..bb69f2e0ba93 100644
> --- a/drivers/counter/microchip-tcb-capture.c
> +++ b/drivers/counter/microchip-tcb-capture.c
> @@ -307,8 +307,6 @@ static int mchp_tc_probe(struct platform_device *pdev)
>  	if (!priv)
>  		return -ENOMEM;
>  
> -	platform_set_drvdata(pdev, priv);
> -
>  	match = of_match_node(atmel_tc_of_match, np->parent);
>  	tcb_config = match->data;
>  	if (!tcb_config) {
> -- 
> 2.33.0
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 07/23] counter: microchip-tcb-capture: Convert to counter_priv() wrapper
  2021-12-27  9:45 ` [PATCH v2 07/23] counter: microchip-tcb-capture: Convert to counter_priv() wrapper Uwe Kleine-König
  2021-12-28 18:05   ` Jonathan Cameron
@ 2021-12-29  7:35   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: William Breathitt Gray @ 2021-12-29  7:35 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Kamel Bouhara, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 2991 bytes --]

On Mon, Dec 27, 2021 at 10:45:10AM +0100, Uwe Kleine-König wrote:
> This is a straight forward conversion to the new counter_priv() wrapper.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>

> ---
>  drivers/counter/microchip-tcb-capture.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
> index bb69f2e0ba93..1b56b7444668 100644
> --- a/drivers/counter/microchip-tcb-capture.c
> +++ b/drivers/counter/microchip-tcb-capture.c
> @@ -72,7 +72,7 @@ static int mchp_tc_count_function_read(struct counter_device *counter,
>  				       struct counter_count *count,
>  				       enum counter_function *function)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  
>  	if (priv->qdec_mode)
>  		*function = COUNTER_FUNCTION_QUADRATURE_X4;
> @@ -86,7 +86,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
>  					struct counter_count *count,
>  					enum counter_function function)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 bmr, cmr;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_BMR, &bmr);
> @@ -148,7 +148,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter,
>  				     struct counter_signal *signal,
>  				     enum counter_signal_level *lvl)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	bool sigstatus;
>  	u32 sr;
>  
> @@ -169,7 +169,7 @@ static int mchp_tc_count_action_read(struct counter_device *counter,
>  				     struct counter_synapse *synapse,
>  				     enum counter_synapse_action *action)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 cmr;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
> @@ -197,7 +197,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
>  				      struct counter_synapse *synapse,
>  				      enum counter_synapse_action action)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 edge = ATMEL_TC_ETRGEDG_NONE;
>  
>  	/* QDEC mode is rising edge only */
> @@ -230,7 +230,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
>  static int mchp_tc_count_read(struct counter_device *counter,
>  			      struct counter_count *count, u64 *val)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 cnt;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CV), &cnt);
> -- 
> 2.33.0
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 11/23] counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper
  2021-12-27  9:45 ` [PATCH v2 11/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
  2021-12-28 18:08   ` Jonathan Cameron
@ 2021-12-29  7:48   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: William Breathitt Gray @ 2021-12-29  7:48 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, Benjamin Gaignard,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 3934 bytes --]

On Mon, Dec 27, 2021 at 10:45:14AM +0100, Uwe Kleine-König wrote:
> This is a straight forward conversion to the new counter_priv() wrapper.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>

> ---
>  drivers/counter/stm32-lptimer-cnt.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c
> index 5168833b1fdf..9cf00e929cc0 100644
> --- a/drivers/counter/stm32-lptimer-cnt.c
> +++ b/drivers/counter/stm32-lptimer-cnt.c
> @@ -141,7 +141,7 @@ static const enum counter_synapse_action stm32_lptim_cnt_synapse_actions[] = {
>  static int stm32_lptim_cnt_read(struct counter_device *counter,
>  				struct counter_count *count, u64 *val)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	u32 cnt;
>  	int ret;
>  
> @@ -158,7 +158,7 @@ static int stm32_lptim_cnt_function_read(struct counter_device *counter,
>  					 struct counter_count *count,
>  					 enum counter_function *function)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  
>  	if (!priv->quadrature_mode) {
>  		*function = COUNTER_FUNCTION_INCREASE;
> @@ -177,7 +177,7 @@ static int stm32_lptim_cnt_function_write(struct counter_device *counter,
>  					  struct counter_count *count,
>  					  enum counter_function function)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  
>  	if (stm32_lptim_is_enabled(priv))
>  		return -EBUSY;
> @@ -200,7 +200,7 @@ static int stm32_lptim_cnt_enable_read(struct counter_device *counter,
>  				       struct counter_count *count,
>  				       u8 *enable)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	int ret;
>  
>  	ret = stm32_lptim_is_enabled(priv);
> @@ -216,7 +216,7 @@ static int stm32_lptim_cnt_enable_write(struct counter_device *counter,
>  					struct counter_count *count,
>  					u8 enable)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	int ret;
>  
>  	/* Check nobody uses the timer, or already disabled/enabled */
> @@ -241,7 +241,7 @@ static int stm32_lptim_cnt_ceiling_read(struct counter_device *counter,
>  					struct counter_count *count,
>  					u64 *ceiling)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  
>  	*ceiling = priv->ceiling;
>  
> @@ -252,7 +252,7 @@ static int stm32_lptim_cnt_ceiling_write(struct counter_device *counter,
>  					 struct counter_count *count,
>  					 u64 ceiling)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  
>  	if (stm32_lptim_is_enabled(priv))
>  		return -EBUSY;
> @@ -277,7 +277,7 @@ static int stm32_lptim_cnt_action_read(struct counter_device *counter,
>  				       struct counter_synapse *synapse,
>  				       enum counter_synapse_action *action)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	enum counter_function function;
>  	int err;
>  
> @@ -321,7 +321,7 @@ static int stm32_lptim_cnt_action_write(struct counter_device *counter,
>  					struct counter_synapse *synapse,
>  					enum counter_synapse_action action)
>  {
> -	struct stm32_lptim_cnt *const priv = counter->priv;
> +	struct stm32_lptim_cnt *const priv = counter_priv(counter);
>  	enum counter_function function;
>  	int err;
>  
> -- 
> 2.33.0
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 12/23] counter: stm32-timer-cnt: Convert to counter_priv() wrapper
  2021-12-27  9:45 ` [PATCH v2 12/23] counter: stm32-timer-cnt: " Uwe Kleine-König
  2021-12-28 18:08   ` Jonathan Cameron
@ 2021-12-29  7:48   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: William Breathitt Gray @ 2021-12-29  7:48 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, Benjamin Gaignard,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 4167 bytes --]

On Mon, Dec 27, 2021 at 10:45:15AM +0100, Uwe Kleine-König wrote:
> This is a straight forward conversion to the new counter_priv() wrapper.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>

> ---
>  drivers/counter/stm32-timer-cnt.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
> index 0546e932db0c..4b05b198a8d8 100644
> --- a/drivers/counter/stm32-timer-cnt.c
> +++ b/drivers/counter/stm32-timer-cnt.c
> @@ -47,7 +47,7 @@ static const enum counter_function stm32_count_functions[] = {
>  static int stm32_count_read(struct counter_device *counter,
>  			    struct counter_count *count, u64 *val)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cnt;
>  
>  	regmap_read(priv->regmap, TIM_CNT, &cnt);
> @@ -59,7 +59,7 @@ static int stm32_count_read(struct counter_device *counter,
>  static int stm32_count_write(struct counter_device *counter,
>  			     struct counter_count *count, const u64 val)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 ceiling;
>  
>  	regmap_read(priv->regmap, TIM_ARR, &ceiling);
> @@ -73,7 +73,7 @@ static int stm32_count_function_read(struct counter_device *counter,
>  				     struct counter_count *count,
>  				     enum counter_function *function)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 smcr;
>  
>  	regmap_read(priv->regmap, TIM_SMCR, &smcr);
> @@ -100,7 +100,7 @@ static int stm32_count_function_write(struct counter_device *counter,
>  				      struct counter_count *count,
>  				      enum counter_function function)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cr1, sms;
>  
>  	switch (function) {
> @@ -140,7 +140,7 @@ static int stm32_count_direction_read(struct counter_device *counter,
>  				      struct counter_count *count,
>  				      enum counter_count_direction *direction)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cr1;
>  
>  	regmap_read(priv->regmap, TIM_CR1, &cr1);
> @@ -153,7 +153,7 @@ static int stm32_count_direction_read(struct counter_device *counter,
>  static int stm32_count_ceiling_read(struct counter_device *counter,
>  				    struct counter_count *count, u64 *ceiling)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 arr;
>  
>  	regmap_read(priv->regmap, TIM_ARR, &arr);
> @@ -166,7 +166,7 @@ static int stm32_count_ceiling_read(struct counter_device *counter,
>  static int stm32_count_ceiling_write(struct counter_device *counter,
>  				     struct counter_count *count, u64 ceiling)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  
>  	if (ceiling > priv->max_arr)
>  		return -ERANGE;
> @@ -181,7 +181,7 @@ static int stm32_count_ceiling_write(struct counter_device *counter,
>  static int stm32_count_enable_read(struct counter_device *counter,
>  				   struct counter_count *count, u8 *enable)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cr1;
>  
>  	regmap_read(priv->regmap, TIM_CR1, &cr1);
> @@ -194,7 +194,7 @@ static int stm32_count_enable_read(struct counter_device *counter,
>  static int stm32_count_enable_write(struct counter_device *counter,
>  				    struct counter_count *count, u8 enable)
>  {
> -	struct stm32_timer_cnt *const priv = counter->priv;
> +	struct stm32_timer_cnt *const priv = counter_priv(counter);
>  	u32 cr1;
>  
>  	if (enable) {
> -- 
> 2.33.0
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 20/23] counter: stm32-timer-cnt: Convert to new counter registration
  2021-12-27  9:45 ` [PATCH v2 20/23] counter: stm32-timer-cnt: Convert to new counter registration Uwe Kleine-König
  2021-12-28 18:25   ` Jonathan Cameron
@ 2021-12-29  8:37   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: William Breathitt Gray @ 2021-12-29  8:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, Benjamin Gaignard, linux-stm32,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 2569 bytes --]

On Mon, Dec 27, 2021 at 10:45:23AM +0100, Uwe Kleine-König wrote:
> This fixes device lifetime issues where it was possible to free a live
> struct device.
> 
> Fixes: ad29937e206f ("counter: Add STM32 Timer quadrature encoder")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>

> ---
>  drivers/counter/stm32-timer-cnt.c | 30 ++++++++++++++++++------------
>  1 file changed, 18 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
> index 4b05b198a8d8..5779ae7c73cf 100644
> --- a/drivers/counter/stm32-timer-cnt.c
> +++ b/drivers/counter/stm32-timer-cnt.c
> @@ -29,7 +29,6 @@ struct stm32_timer_regs {
>  };
>  
>  struct stm32_timer_cnt {
> -	struct counter_device counter;
>  	struct regmap *regmap;
>  	struct clk *clk;
>  	u32 max_arr;
> @@ -317,31 +316,38 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev)
>  	struct stm32_timers *ddata = dev_get_drvdata(pdev->dev.parent);
>  	struct device *dev = &pdev->dev;
>  	struct stm32_timer_cnt *priv;
> +	struct counter_device *counter;
> +	int ret;
>  
>  	if (IS_ERR_OR_NULL(ddata))
>  		return -EINVAL;
>  
> -	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> -	if (!priv)
> +	counter = devm_counter_alloc(dev, sizeof(*priv));
> +	if (!counter)
>  		return -ENOMEM;
>  
> +	priv = counter_priv(counter);
> +
>  	priv->regmap = ddata->regmap;
>  	priv->clk = ddata->clk;
>  	priv->max_arr = ddata->max_arr;
>  
> -	priv->counter.name = dev_name(dev);
> -	priv->counter.parent = dev;
> -	priv->counter.ops = &stm32_timer_cnt_ops;
> -	priv->counter.counts = &stm32_counts;
> -	priv->counter.num_counts = 1;
> -	priv->counter.signals = stm32_signals;
> -	priv->counter.num_signals = ARRAY_SIZE(stm32_signals);
> -	priv->counter.priv = priv;
> +	counter->name = dev_name(dev);
> +	counter->parent = dev;
> +	counter->ops = &stm32_timer_cnt_ops;
> +	counter->counts = &stm32_counts;
> +	counter->num_counts = 1;
> +	counter->signals = stm32_signals;
> +	counter->num_signals = ARRAY_SIZE(stm32_signals);
>  
>  	platform_set_drvdata(pdev, priv);
>  
>  	/* Register Counter device */
> -	return devm_counter_register(dev, &priv->counter);
> +	ret = devm_counter_add(dev, counter);
> +	if (ret < 0)
> +		dev_err_probe(dev, ret, "Failed to add counter\n");
> +
> +	return ret;
>  }
>  
>  static int __maybe_unused stm32_timer_cnt_suspend(struct device *dev)
> -- 
> 2.33.0
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 21/23] counter: stm32-lptimer-cnt: Convert to new counter registration
  2021-12-27  9:45 ` [PATCH v2 21/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
  2021-12-28 18:26   ` Jonathan Cameron
@ 2021-12-29  8:39   ` William Breathitt Gray
  1 sibling, 0 replies; 22+ messages in thread
From: William Breathitt Gray @ 2021-12-29  8:39 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Lars-Peter Clausen, kernel, Jonathan Cameron, linux-iio,
	Greg Kroah-Hartman, linux-kernel, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, Benjamin Gaignard, linux-stm32,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 3007 bytes --]

On Mon, Dec 27, 2021 at 10:45:24AM +0100, Uwe Kleine-König wrote:
> This fixes device lifetime issues where it was possible to free a live
> struct device.
> 
> Fixes: 597f55e3f36c ("counter: stm32-lptimer: add counter device")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>

> ---
>  drivers/counter/stm32-lptimer-cnt.c | 33 +++++++++++++++++------------
>  1 file changed, 19 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c
> index 9cf00e929cc0..68031d93ce89 100644
> --- a/drivers/counter/stm32-lptimer-cnt.c
> +++ b/drivers/counter/stm32-lptimer-cnt.c
> @@ -20,7 +20,6 @@
>  #include <linux/types.h>
>  
>  struct stm32_lptim_cnt {
> -	struct counter_device counter;
>  	struct device *dev;
>  	struct regmap *regmap;
>  	struct clk *clk;
> @@ -411,14 +410,17 @@ static struct counter_count stm32_lptim_in1_counts = {
>  static int stm32_lptim_cnt_probe(struct platform_device *pdev)
>  {
>  	struct stm32_lptimer *ddata = dev_get_drvdata(pdev->dev.parent);
> +	struct counter_device *counter;
>  	struct stm32_lptim_cnt *priv;
> +	int ret;
>  
>  	if (IS_ERR_OR_NULL(ddata))
>  		return -EINVAL;
>  
> -	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> -	if (!priv)
> +	counter = devm_counter_alloc(&pdev->dev, sizeof(*priv));
> +	if (!counter)
>  		return -ENOMEM;
> +	priv = counter_priv(counter);
>  
>  	priv->dev = &pdev->dev;
>  	priv->regmap = ddata->regmap;
> @@ -426,23 +428,26 @@ static int stm32_lptim_cnt_probe(struct platform_device *pdev)
>  	priv->ceiling = STM32_LPTIM_MAX_ARR;
>  
>  	/* Initialize Counter device */
> -	priv->counter.name = dev_name(&pdev->dev);
> -	priv->counter.parent = &pdev->dev;
> -	priv->counter.ops = &stm32_lptim_cnt_ops;
> +	counter->name = dev_name(&pdev->dev);
> +	counter->parent = &pdev->dev;
> +	counter->ops = &stm32_lptim_cnt_ops;
>  	if (ddata->has_encoder) {
> -		priv->counter.counts = &stm32_lptim_enc_counts;
> -		priv->counter.num_signals = ARRAY_SIZE(stm32_lptim_cnt_signals);
> +		counter->counts = &stm32_lptim_enc_counts;
> +		counter->num_signals = ARRAY_SIZE(stm32_lptim_cnt_signals);
>  	} else {
> -		priv->counter.counts = &stm32_lptim_in1_counts;
> -		priv->counter.num_signals = 1;
> +		counter->counts = &stm32_lptim_in1_counts;
> +		counter->num_signals = 1;
>  	}
> -	priv->counter.num_counts = 1;
> -	priv->counter.signals = stm32_lptim_cnt_signals;
> -	priv->counter.priv = priv;
> +	counter->num_counts = 1;
> +	counter->signals = stm32_lptim_cnt_signals;
>  
>  	platform_set_drvdata(pdev, priv);
>  
> -	return devm_counter_register(&pdev->dev, &priv->counter);
> +	ret = devm_counter_add(&pdev->dev, counter);
> +	if (ret < 0)
> +		return dev_err_probe(&pdev->dev, ret, "Failed to add counter\n");
> +
> +	return 0;
>  }
>  
>  #ifdef CONFIG_PM_SLEEP
> -- 
> 2.33.0
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 00/23] counter: cleanups and device lifetime fixes
  2021-12-28 17:35   ` Jonathan Cameron
@ 2021-12-29  8:49     ` William Breathitt Gray
  0 siblings, 0 replies; 22+ messages in thread
From: William Breathitt Gray @ 2021-12-29  8:49 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Lars-Peter Clausen, Uwe Kleine-König, kernel,
	Jonathan Cameron, linux-iio, Greg Kroah-Hartman, linux-kernel,
	Patrick Havelange, Kamel Bouhara, linux-arm-kernel,
	Syed Nayyar Waris, Oleksij Rempel, Jarkko Nikula, David Lechner,
	Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue, linux-stm32,
	Jonathan Corbet, linux-doc, Ahmad Fatoum, Felipe Balbi (Intel),
	Raymond Tan, Benjamin Gaignard


[-- Attachment #1.1: Type: text/plain, Size: 1835 bytes --]

On Tue, Dec 28, 2021 at 05:35:58PM +0000, Jonathan Cameron wrote:
> On Mon, 27 Dec 2021 13:25:25 +0100
> Lars-Peter Clausen <lars@metafoo.de> wrote:
> 
> > On 12/27/21 10:45 AM, Uwe Kleine-König wrote:
> > > [...]
> > >
> > >   - I wonder why counter is a bus and not a class device type. There is
> > >     no driver that would ever bind a counter device, is there? So
> > >     /sys/bus/counter/driver is always empty.
> > >  
> > There used to be a time when GKH said that we do not want new driver 
> > classes. And all new subsystems should use bus since bus is a superset 
> > of class. This restriction has been eased since then.
> > 
> > But it was around when the IIO subsystem was merged and since the 
> > counter subsystem originated from the IIO subsystem I assume it just 
> > copied this.
> > 
> 
> Yup. Discussion about this back then with one view being there
> should never have been class in the first place.
> 
> https://lore.kernel.org/lkml/4B571DA4.6070603@cam.ac.uk/
> 
> For anyone who loves the history of these things...
> 
> FWIW I think Greg suggested IIO should be a bus because we were hanging
> a bunch of different types of device off a class and it was getting messy.
> Kay then gave some history on class vs bus and suggested no new
> subsystem should use class.
> 
> Ah well, opinions change over time!
> 
> Also interesting to see we were discussing a bridge to input all that
> time ago and it's still not gone beyond various prototypes (with
> exception of touch screens).
> 
> Jonathan

Yes this is the reason: Counter subsystem just followed the structure of
the IIO subsystem originally which is how it ended up as a bus; changing
it to a class now would break userspace expectations so that is why it
remains a bus still.

William Breathitt Gray

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-12-29  8:51 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-27  9:45 [PATCH v2 00/23] counter: cleanups and device lifetime fixes Uwe Kleine-König
2021-12-27  9:45 ` [PATCH v2 03/23] counter: microchip-tcb-capture: Drop unused platform_set_drvdata() Uwe Kleine-König
2021-12-28 17:38   ` Jonathan Cameron
2021-12-29  6:44   ` William Breathitt Gray
2021-12-27  9:45 ` [PATCH v2 07/23] counter: microchip-tcb-capture: Convert to counter_priv() wrapper Uwe Kleine-König
2021-12-28 18:05   ` Jonathan Cameron
2021-12-29  7:35   ` William Breathitt Gray
2021-12-27  9:45 ` [PATCH v2 11/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
2021-12-28 18:08   ` Jonathan Cameron
2021-12-29  7:48   ` William Breathitt Gray
2021-12-27  9:45 ` [PATCH v2 12/23] counter: stm32-timer-cnt: " Uwe Kleine-König
2021-12-28 18:08   ` Jonathan Cameron
2021-12-29  7:48   ` William Breathitt Gray
2021-12-27  9:45 ` [PATCH v2 20/23] counter: stm32-timer-cnt: Convert to new counter registration Uwe Kleine-König
2021-12-28 18:25   ` Jonathan Cameron
2021-12-29  8:37   ` William Breathitt Gray
2021-12-27  9:45 ` [PATCH v2 21/23] counter: stm32-lptimer-cnt: " Uwe Kleine-König
2021-12-28 18:26   ` Jonathan Cameron
2021-12-29  8:39   ` William Breathitt Gray
2021-12-27 12:25 ` [PATCH v2 00/23] counter: cleanups and device lifetime fixes Lars-Peter Clausen
2021-12-28 17:35   ` Jonathan Cameron
2021-12-29  8:49     ` William Breathitt Gray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox