lkml.org 
[lkml]   [2020]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 07/15] drm/panfrost: use device_property_present to check for OPP
    Date
    Instead of expecting an error from dev_pm_opp_of_add_table()
    do a simple device_property_present() check.

    Signed-off-by: Clément Péron <peron.clem@gmail.com>
    ---
    drivers/gpu/drm/panfrost/panfrost_devfreq.c | 14 +++++++++-----
    1 file changed, 9 insertions(+), 5 deletions(-)

    diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
    index d9007f44b772..fce21c682414 100644
    --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
    +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
    @@ -96,15 +96,19 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
    struct thermal_cooling_device *cooling;
    struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq;

    - ret = dev_pm_opp_of_add_table(dev);
    - if (ret == -ENODEV) /* Optional, continue without devfreq */
    + if (!device_property_present(dev, "operating-points-v2"))
    + /* Optional, continue without devfreq */
    return 0;
    - else if (ret)
    - return ret;
    - pfdevfreq->opp_of_table_added = true;

    spin_lock_init(&pfdevfreq->lock);

    + ret = dev_pm_opp_of_add_table(dev);
    + if (ret) {
    + DRM_DEV_ERROR(dev, "Couldn't add OPP table\n");
    + goto err_fini;
    + }
    + pfdevfreq->opp_of_table_added = true;
    +
    panfrost_devfreq_reset(pfdevfreq);

    cur_freq = clk_get_rate(pfdev->clock);
    --
    2.20.1
    \
     
     \ /
      Last update: 2020-05-10 19:10    [W:3.543 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site