@@ -50,6 +50,8 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
if (!*pdev)
return -ENOMEM;
+ info->dev = dev;
+
(*pdev)->dev.platform_data = info;
(*pdev)->dev.release = release;
@@ -57,11 +59,10 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
if (ret < 0) {
platform_device_put(*pdev);
*pdev = NULL;
- } else {
- info->dev = dev;
+ info->dev = NULL;
}
- return 0;
+ return ret;
}
static inline void soc_camera_platform_del(const struct soc_camera_link *icl,