@@ -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-
134129static 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,
146141static 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,
353348static 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,
366361static 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