drm/rockchip: cdn-dp: Don't try to release firmware when not loaded
authorJeffy Chen <jeffy.chen@rock-chips.com>
Thu, 6 Apr 2017 12:31:18 +0000 (20:31 +0800)
committerSean Paul <seanpaul@chromium.org>
Fri, 7 Apr 2017 17:28:32 +0000 (13:28 -0400)
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-6-git-send-email-jeffy.chen@rock-chips.com
drivers/gpu/drm/rockchip/cdn-dp-core.c

index 4e55d63..ee4195d 100644 (file)
@@ -1053,6 +1053,7 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data)
        dp->connected = false;
        dp->active = false;
        dp->active_port = -1;
+       dp->fw_loaded = false;
 
        INIT_WORK(&dp->event_work, cdn_dp_pd_event_work);
 
@@ -1133,7 +1134,8 @@ static void cdn_dp_unbind(struct device *dev, struct device *master, void *data)
        connector->funcs->destroy(connector);
 
        pm_runtime_disable(dev);
-       release_firmware(dp->fw);
+       if (dp->fw_loaded)
+               release_firmware(dp->fw);
        kfree(dp->edid);
        dp->edid = NULL;
 }