* [PATCH 0/2] counter: ti-eqep: small cleanups
@ 2024-06-09 20:06 David Lechner
2024-06-09 20:06 ` [PATCH 1/2] counter: ti-eqep: remove unused struct member David Lechner
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: David Lechner @ 2024-06-09 20:06 UTC (permalink / raw)
To: William Breathitt Gray
Cc: David Lechner, Judith Mendez, linux-iio, linux-kernel
Judith got me looking at this driver again, so I noticed a few small
things that could be cleaned up.
---
David Lechner (2):
counter: ti-eqep: remove unused struct member
counter: ti-eqep: remove counter_priv() wrapper
drivers/counter/ti-eqep.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
---
base-commit: bb3f1c5fc434b0b177449f7f73ea9b112b397dd1
change-id: 20240609-ti-eqep-cleanup-254e6ba1e386
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] counter: ti-eqep: remove unused struct member 2024-06-09 20:06 [PATCH 0/2] counter: ti-eqep: small cleanups David Lechner @ 2024-06-09 20:06 ` David Lechner 2024-06-10 13:48 ` Judith Mendez 2024-06-09 20:06 ` [PATCH 2/2] counter: ti-eqep: remove counter_priv() wrapper David Lechner 2024-06-16 8:36 ` [PATCH 0/2] counter: ti-eqep: small cleanups William Breathitt Gray 2 siblings, 1 reply; 5+ messages in thread From: David Lechner @ 2024-06-09 20:06 UTC (permalink / raw) To: William Breathitt Gray Cc: David Lechner, Judith Mendez, linux-iio, linux-kernel Since commit 8817c2d03a85 ("counter: ti-eqep: Convert to counter_priv() wrapper") the counter field in struct ti_eqep_cnt is not used anymore. Remove it. Signed-off-by: David Lechner <dlechner@baylibre.com> --- drivers/counter/ti-eqep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c index 072b11fd6b32..30c35b6c6050 100644 --- a/drivers/counter/ti-eqep.c +++ b/drivers/counter/ti-eqep.c @@ -82,7 +82,6 @@ enum ti_eqep_count_func { }; struct ti_eqep_cnt { - struct counter_device counter; struct regmap *regmap32; struct regmap *regmap16; }; -- 2.45.2 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] counter: ti-eqep: remove unused struct member 2024-06-09 20:06 ` [PATCH 1/2] counter: ti-eqep: remove unused struct member David Lechner @ 2024-06-10 13:48 ` Judith Mendez 0 siblings, 0 replies; 5+ messages in thread From: Judith Mendez @ 2024-06-10 13:48 UTC (permalink / raw) To: David Lechner, William Breathitt Gray; +Cc: linux-iio, linux-kernel Hi David, On 6/9/24 3:06 PM, David Lechner wrote: > Since commit 8817c2d03a85 ("counter: ti-eqep: Convert to counter_priv() > wrapper") the counter field in struct ti_eqep_cnt is not used anymore. > Remove it. > > Signed-off-by: David Lechner <dlechner@baylibre.com> > --- Reviewed-by: Judith Mendez <jm@ti.com> ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] counter: ti-eqep: remove counter_priv() wrapper 2024-06-09 20:06 [PATCH 0/2] counter: ti-eqep: small cleanups David Lechner 2024-06-09 20:06 ` [PATCH 1/2] counter: ti-eqep: remove unused struct member David Lechner @ 2024-06-09 20:06 ` David Lechner 2024-06-16 8:36 ` [PATCH 0/2] counter: ti-eqep: small cleanups William Breathitt Gray 2 siblings, 0 replies; 5+ messages in thread From: David Lechner @ 2024-06-09 20:06 UTC (permalink / raw) To: William Breathitt Gray Cc: David Lechner, Judith Mendez, linux-iio, linux-kernel The ti_eqep_count_from_counter() function is just a wrapper around counter_priv(). counter_priv() can be used directly, so we don't need the wrapper function. Remove it. Signed-off-by: David Lechner <dlechner@baylibre.com> --- drivers/counter/ti-eqep.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c index 30c35b6c6050..924e379303dd 100644 --- a/drivers/counter/ti-eqep.c +++ b/drivers/counter/ti-eqep.c @@ -86,15 +86,10 @@ struct ti_eqep_cnt { struct regmap *regmap16; }; -static struct ti_eqep_cnt *ti_eqep_count_from_counter(struct counter_device *counter) -{ - return counter_priv(counter); -} - static int ti_eqep_count_read(struct counter_device *counter, struct counter_count *count, u64 *val) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 cnt; regmap_read(priv->regmap32, QPOSCNT, &cnt); @@ -106,7 +101,7 @@ static int ti_eqep_count_read(struct counter_device *counter, static int ti_eqep_count_write(struct counter_device *counter, struct counter_count *count, u64 val) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 max; regmap_read(priv->regmap32, QPOSMAX, &max); @@ -120,7 +115,7 @@ static int ti_eqep_function_read(struct counter_device *counter, struct counter_count *count, enum counter_function *function) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 qdecctl; regmap_read(priv->regmap16, QDECCTL, &qdecctl); @@ -147,7 +142,7 @@ static int ti_eqep_function_write(struct counter_device *counter, struct counter_count *count, enum counter_function function) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); enum ti_eqep_count_func qsrc; switch (function) { @@ -177,7 +172,7 @@ static int ti_eqep_action_read(struct counter_device *counter, struct counter_synapse *synapse, enum counter_synapse_action *action) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); enum counter_function function; u32 qdecctl; int err; @@ -249,7 +244,7 @@ static int ti_eqep_position_ceiling_read(struct counter_device *counter, struct counter_count *count, u64 *ceiling) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 qposmax; regmap_read(priv->regmap32, QPOSMAX, &qposmax); @@ -263,7 +258,7 @@ static int ti_eqep_position_ceiling_write(struct counter_device *counter, struct counter_count *count, u64 ceiling) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); if (ceiling != (u32)ceiling) return -ERANGE; @@ -276,7 +271,7 @@ static int ti_eqep_position_ceiling_write(struct counter_device *counter, static int ti_eqep_position_enable_read(struct counter_device *counter, struct counter_count *count, u8 *enable) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 qepctl; regmap_read(priv->regmap16, QEPCTL, &qepctl); @@ -289,7 +284,7 @@ static int ti_eqep_position_enable_read(struct counter_device *counter, static int ti_eqep_position_enable_write(struct counter_device *counter, struct counter_count *count, u8 enable) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); regmap_write_bits(priv->regmap16, QEPCTL, QEPCTL_PHEN, enable ? -1 : 0); -- 2.45.2 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] counter: ti-eqep: small cleanups 2024-06-09 20:06 [PATCH 0/2] counter: ti-eqep: small cleanups David Lechner 2024-06-09 20:06 ` [PATCH 1/2] counter: ti-eqep: remove unused struct member David Lechner 2024-06-09 20:06 ` [PATCH 2/2] counter: ti-eqep: remove counter_priv() wrapper David Lechner @ 2024-06-16 8:36 ` William Breathitt Gray 2 siblings, 0 replies; 5+ messages in thread From: William Breathitt Gray @ 2024-06-16 8:36 UTC (permalink / raw) To: David Lechner Cc: William Breathitt Gray, Judith Mendez, linux-iio, linux-kernel On Sun, 09 Jun 2024 15:06:14 -0500, David Lechner wrote: > Judith got me looking at this driver again, so I noticed a few small > things that could be cleaned up. > Applied, thanks! [1/2] counter: ti-eqep: remove unused struct member commit: 42c1debf9b68d5f7c6deacda5fa1a8b83722c052 [2/2] counter: ti-eqep: remove counter_priv() wrapper commit: f045f1e1cc530f34688f9e71b1aeef6fece0f514 Best regards, -- William Breathitt Gray <wbg@kernel.org> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-06-16 8:36 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-06-09 20:06 [PATCH 0/2] counter: ti-eqep: small cleanups David Lechner 2024-06-09 20:06 ` [PATCH 1/2] counter: ti-eqep: remove unused struct member David Lechner 2024-06-10 13:48 ` Judith Mendez 2024-06-09 20:06 ` [PATCH 2/2] counter: ti-eqep: remove counter_priv() wrapper David Lechner 2024-06-16 8:36 ` [PATCH 0/2] counter: ti-eqep: small cleanups 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
all inboxes | Powered by JetHome®