• Alex Elder's avatar
    net: ipa: get clock in ipa_probe() · 923a6b69
    Alex Elder authored
    Any entry point that leads to IPA hardware access must ensure the
    hardware is operational (clocked).  Currently we ensure this by
    taking an extra clock reference during setup that is not released
    until we receive a system suspend request.  But this extra reference
    will soon go away.
    
    When the platform driver ->probe function is called, we first need
    hardware access in ipa_config().  Although ipa_config() takes an IPA
    clock reference, it the special reference taken to prevent suspending
    the hardware.
    
    Have ipa_probe() take a reference before calling ipa_config(), so
    that the "no-suspend" reference can eventually go away.  Drop this
    reference before ipa_probe() returns.
    
    Similarly, the driver ->remove function can be called at any time.
    Take an IPA clock reference at the beginning of that function, and
    drop it again after the deconfig stage has completed (at which point
    hardware access is no longer needed).
    Signed-off-by: default avatarAlex Elder <elder@linaro.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    923a6b69
ipa_main.c 26.6 KB