Skip to content
  • Enric Balletbo i Serra's avatar
    PM / devfreq: rk3399_dmc: Fix duplicated opp table on reload. · d6e98f3e
    Enric Balletbo i Serra authored and MyungJoo Ham's avatar MyungJoo Ham committed
    The opp table is not removed when the driver is unloaded neither when
    there is an error within probe, so if the driver is reloaded the opp
    core shows the following warning:
    
      rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq:
                   200000000, volt: 900000, enabled: 1. New: freq: 200000000,
                   volt: 900000, enabled: 1
      rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq:
                   400000000, volt: 900000, enabled: 1. New: freq: 400000000,
                   volt: 900000, enabled: 1
      rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq:
                   666000000, volt: 900000, enabled: 1. New: freq: 666000000,
                   volt: 900000, enabled: 1
      rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq:
                   800000000, volt: 900000, enabled: 1. New: freq: 800000000,
                   volt: 900000, enabled: 1
      rk3399-dmc-freq dmc: _opp_add: duplicate OPPs detected. Existing: freq:
                   928000000, volt: 900000, enabled: 1. New: freq: 928000000,
                   volt: 900000, enabled: 1
    
    This patch fixes the error path in the probe function and adds a .remove
    function to properly cleanup the opp table on unloading.
    
    Fixes: 5a893e31
    
     (PM / devfreq: rockchip: add devfreq driver for rk3399 dmc)
    Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
    Reviewed-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
    Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
    d6e98f3e