Hi Magnus On Wed, 16 Mar 2011, Magnus Damm wrote: > On Tue, Feb 22, 2011 at 6:57 PM, Guennadi Liakhovetski > <g.liakhovetski@xxxxxx> wrote: > > Use soc_camera_platform helper functions to dynamically manage the > > camera device. > > > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx> > > --- > > arch/arm/mach-shmobile/board-mackerel.c | 28 +++++++--------------------- > > 1 files changed, 7 insertions(+), 21 deletions(-) > > Hi Guennadi, > > Thanks for your work on this. The soc_camera_platform interface has > become much much nicer with these patches. > > I just tested patch 1/3 and patch 3/3 on my Mackerel board. Thanks for testing! > Unfortunately I get this printout on the console: > > sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver attached to camera 0 > soc_camera_platform soc_camera_platform.0: Platform has not set > soc_camera_device pointer! > soc_camera_platform: probe of soc_camera_platform.0 failed with error -22 > sh_mobile_ceu sh_mobile_ceu.0: SuperH Mobile CEU driver detached from camera 0 > > Without these two patches everything work just fine. Any ideas on how > to fix it? I'd be happy to test V2. =) Hm, yes, looks like I'm initialising the pointer too late. Could you, please, test the patch below on top, if it helps, I'll send v2. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ 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, -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html