The only device-specific part of panthor's get_dev_status devfreq
callback is getting the clock frequency. All the other logic surrounding
what it does may be useful for other devfreq implementations however.

Make it call into get_cur_freq instead of poking the common clock
framework directly.

Signed-off-by: Nicolas Frattaroli <[email protected]>
---
 drivers/gpu/drm/panthor/panthor_devfreq.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panthor/panthor_devfreq.c 
b/drivers/gpu/drm/panthor/panthor_devfreq.c
index 
8903f60c0a3f06313ac2008791c210ff32b6bd52..118da7cbb3c809e4aabfef7d20914e61c2b62555
 100644
--- a/drivers/gpu/drm/panthor/panthor_devfreq.c
+++ b/drivers/gpu/drm/panthor/panthor_devfreq.c
@@ -87,9 +87,13 @@ static int panthor_devfreq_get_dev_status(struct device *dev,
 {
        struct panthor_device *ptdev = dev_get_drvdata(dev);
        struct panthor_devfreq *pdevfreq = ptdev->devfreq;
+       struct devfreq_dev_profile *p = pdevfreq->devfreq->profile;
        unsigned long irqflags;
+       int ret;
 
-       status->current_frequency = clk_get_rate(ptdev->clks.core);
+       ret = p->get_cur_freq(dev, &status->current_frequency);
+       if (ret)
+               return ret;
 
        spin_lock_irqsave(&pdevfreq->lock, irqflags);
 

-- 
2.51.0


Reply via email to