diff mbox

[3/3] ARM: switch mackerel to dynamically manage the platform camera

Message ID Pine.LNX.4.64.1103211421040.24139@axis700.grange (mailing list archive)
State RFC
Headers show

Commit Message

Guennadi Liakhovetski March 21, 2011, 1:22 p.m. UTC
None
diff mbox

Patch

diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index fbf4b79..6d7a4fd 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -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,