|
@@ -74,7 +74,6 @@
|
|
|
static struct platform_device *
|
|
|
lpe_audio_platdev_create(struct drm_i915_private *dev_priv)
|
|
|
{
|
|
|
- int ret;
|
|
|
struct drm_device *dev = &dev_priv->drm;
|
|
|
struct platform_device_info pinfo = {};
|
|
|
struct resource *rsc;
|
|
@@ -119,24 +118,19 @@ lpe_audio_platdev_create(struct drm_i915_private *dev_priv)
|
|
|
spin_lock_init(&pdata->lpe_audio_slock);
|
|
|
|
|
|
platdev = platform_device_register_full(&pinfo);
|
|
|
+ kfree(rsc);
|
|
|
+ kfree(pdata);
|
|
|
+
|
|
|
if (IS_ERR(platdev)) {
|
|
|
- ret = PTR_ERR(platdev);
|
|
|
DRM_ERROR("Failed to allocate LPE audio platform device\n");
|
|
|
- goto err;
|
|
|
+ return platdev;
|
|
|
}
|
|
|
|
|
|
- kfree(rsc);
|
|
|
-
|
|
|
pm_runtime_forbid(&platdev->dev);
|
|
|
pm_runtime_set_active(&platdev->dev);
|
|
|
pm_runtime_enable(&platdev->dev);
|
|
|
|
|
|
return platdev;
|
|
|
-
|
|
|
-err:
|
|
|
- kfree(rsc);
|
|
|
- kfree(pdata);
|
|
|
- return ERR_PTR(ret);
|
|
|
}
|
|
|
|
|
|
static void lpe_audio_platdev_destroy(struct drm_i915_private *dev_priv)
|