counter: ftm-quaddec: Convert to counter_priv() wrapper
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 30 Dec 2021 15:02:46 +0000 (16:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Dec 2021 16:44:06 +0000 (17:44 +0100)
This is a straight forward conversion to the new counter_priv() wrapper.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/counter/ftm-quaddec.c

index 9272f7b58bebd07b7efa792b0ca26ba95f7d35bc..f5d92df6a611ba02b4b19c11aba38184805db700 100644 (file)
@@ -118,7 +118,7 @@ static void ftm_quaddec_disable(void *ftm)
 static int ftm_quaddec_get_prescaler(struct counter_device *counter,
                                     struct counter_count *count, u32 *cnt_mode)
 {
-       struct ftm_quaddec *ftm = counter->priv;
+       struct ftm_quaddec *ftm = counter_priv(counter);
        uint32_t scflags;
 
        ftm_read(ftm, FTM_SC, &scflags);
@@ -131,7 +131,7 @@ static int ftm_quaddec_get_prescaler(struct counter_device *counter,
 static int ftm_quaddec_set_prescaler(struct counter_device *counter,
                                     struct counter_count *count, u32 cnt_mode)
 {
-       struct ftm_quaddec *ftm = counter->priv;
+       struct ftm_quaddec *ftm = counter_priv(counter);
 
        mutex_lock(&ftm->ftm_quaddec_mutex);
 
@@ -162,7 +162,7 @@ static int ftm_quaddec_count_read(struct counter_device *counter,
                                  struct counter_count *count,
                                  u64 *val)
 {
-       struct ftm_quaddec *const ftm = counter->priv;
+       struct ftm_quaddec *const ftm = counter_priv(counter);
        uint32_t cntval;
 
        ftm_read(ftm, FTM_CNT, &cntval);
@@ -176,7 +176,7 @@ static int ftm_quaddec_count_write(struct counter_device *counter,
                                   struct counter_count *count,
                                   const u64 val)
 {
-       struct ftm_quaddec *const ftm = counter->priv;
+       struct ftm_quaddec *const ftm = counter_priv(counter);
 
        if (val != 0) {
                dev_warn(&ftm->pdev->dev, "Can only accept '0' as new counter value\n");