From 324982fad1106c60a0b52e54e758b9dda6d414e1 Mon Sep 17 00:00:00 2001 From: Amir Vajid Date: Thu, 14 May 2020 08:01:42 -0700 Subject: [PATCH] PM / devfreq: qoslat: implement get_dev_status() The qoslat devfreq device does not implement the get_dev_status() devfreq profile API. This will lead to a crash if a governor tries to invoke devfreq_update_stats(). Implement the API to prevent this from happening. Change-Id: I668c3b55a1585d8eb561da03475e1567b194feef Signed-off-by: Amir Vajid --- drivers/devfreq/devfreq_qcom_qoslat.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/devfreq_qcom_qoslat.c b/drivers/devfreq/devfreq_qcom_qoslat.c index a75154138cb5..c24368a0ba8a 100644 --- a/drivers/devfreq/devfreq_qcom_qoslat.c +++ b/drivers/devfreq/devfreq_qcom_qoslat.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */ #define pr_fmt(fmt) "devfreq-qcom-qoslat: " fmt @@ -82,6 +82,16 @@ static int dev_get_cur_freq(struct device *dev, unsigned long *freq) return 0; } +static int dev_get_dev_status(struct device *dev, + struct devfreq_dev_status *stat) +{ + struct qoslat_data *d = dev_get_drvdata(dev); + + stat->current_frequency = d->qos_level; + + return 0; +} + static int devfreq_qcom_qoslat_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -114,6 +124,7 @@ static int devfreq_qcom_qoslat_probe(struct platform_device *pdev) p = &d->profile; p->target = dev_target; p->get_cur_freq = dev_get_cur_freq; + p->get_dev_status = dev_get_dev_status; p->polling_ms = 10; ret = dev_pm_opp_of_add_table(dev);