• Rafael J. Wysocki's avatar
    PM: i2c-designware-platdrv: Clean up PM handling in probe · 126dbc6b
    Rafael J. Wysocki authored
    The power management handling in dw_i2c_plat_probe() is somewhat
    messy and it is rather hard to figure out the code intention for
    the case when pm_disabled is set.  In that case, the driver doesn't
    enable runtime PM at all, but in addition to that it calls
    pm_runtime_forbid() as though it wasn't sure if runtime PM might
    be enabled for the device later by someone else.
    
    Although that concern doesn't seem to be actually valid, the
    device is clearly still expected to be PM-capable even in the
    pm_disabled set case, so a better approach would be to enable
    runtime PM for it unconditionally and prevent it from being
    runtime-suspended by using pm_runtime_get_noresume().
    
    Make the driver do that.
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
    126dbc6b
i2c-designware-platdrv.c 12.8 KB