Skip to content

Commit 1a84aaa

Browse files
dlechWilliam Breathitt Gray
authored andcommitted
counter: ti-eqep: remove counter_priv() wrapper
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: William Breathitt Gray <[email protected]>
1 parent bc4666b commit 1a84aaa

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

drivers/counter/ti-eqep.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,10 @@ struct ti_eqep_cnt {
126126
struct regmap *regmap16;
127127
};
128128

129-
static struct ti_eqep_cnt *ti_eqep_count_from_counter(struct counter_device *counter)
130-
{
131-
return counter_priv(counter);
132-
}
133-
134129
static int ti_eqep_count_read(struct counter_device *counter,
135130
struct counter_count *count, u64 *val)
136131
{
137-
struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
132+
struct ti_eqep_cnt *priv = counter_priv(counter);
138133
u32 cnt;
139134

140135
regmap_read(priv->regmap32, QPOSCNT, &cnt);
@@ -146,7 +141,7 @@ static int ti_eqep_count_read(struct counter_device *counter,
146141
static int ti_eqep_count_write(struct counter_device *counter,
147142
struct counter_count *count, u64 val)
148143
{
149-
struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
144+
struct ti_eqep_cnt *priv = counter_priv(counter);
150145
u32 max;
151146

152147
regmap_read(priv->regmap32, QPOSMAX, &max);
@@ -160,7 +155,7 @@ static int ti_eqep_function_read(struct counter_device *counter,
160155
struct counter_count *count,
161156
enum counter_function *function)
162157
{
163-
struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
158+
struct ti_eqep_cnt *priv = counter_priv(counter);
164159
u32 qdecctl;
165160

166161
regmap_read(priv->regmap16, QDECCTL, &qdecctl);
@@ -187,7 +182,7 @@ static int ti_eqep_function_write(struct counter_device *counter,
187182
struct counter_count *count,
188183
enum counter_function function)
189184
{
190-
struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
185+
struct ti_eqep_cnt *priv = counter_priv(counter);
191186
enum ti_eqep_count_func qsrc;
192187

193188
switch (function) {
@@ -217,7 +212,7 @@ static int ti_eqep_action_read(struct counter_device *counter,
217212
struct counter_synapse *synapse,
218213
enum counter_synapse_action *action)
219214
{
220-
struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
215+
struct ti_eqep_cnt *priv = counter_priv(counter);
221216
enum counter_function function;
222217
u32 qdecctl;
223218
int err;
@@ -326,7 +321,7 @@ static int ti_eqep_position_ceiling_read(struct counter_device *counter,
326321
struct counter_count *count,
327322
u64 *ceiling)
328323
{
329-
struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
324+
struct ti_eqep_cnt *priv = counter_priv(counter);
330325
u32 qposmax;
331326

332327
regmap_read(priv->regmap32, QPOSMAX, &qposmax);
@@ -340,7 +335,7 @@ static int ti_eqep_position_ceiling_write(struct counter_device *counter,
340335
struct counter_count *count,
341336
u64 ceiling)
342337
{
343-
struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
338+
struct ti_eqep_cnt *priv = counter_priv(counter);
344339

345340
if (ceiling != (u32)ceiling)
346341
return -ERANGE;
@@ -353,7 +348,7 @@ static int ti_eqep_position_ceiling_write(struct counter_device *counter,
353348
static int ti_eqep_position_enable_read(struct counter_device *counter,
354349
struct counter_count *count, u8 *enable)
355350
{
356-
struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
351+
struct ti_eqep_cnt *priv = counter_priv(counter);
357352
u32 qepctl;
358353

359354
regmap_read(priv->regmap16, QEPCTL, &qepctl);
@@ -366,7 +361,7 @@ static int ti_eqep_position_enable_read(struct counter_device *counter,
366361
static int ti_eqep_position_enable_write(struct counter_device *counter,
367362
struct counter_count *count, u8 enable)
368363
{
369-
struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter);
364+
struct ti_eqep_cnt *priv = counter_priv(counter);
370365

371366
regmap_write_bits(priv->regmap16, QEPCTL, QEPCTL_PHEN, enable ? -1 : 0);
372367

0 commit comments

Comments
 (0)