Skip to contentSkip to conversation

drm/exynos: consider deferred probe case

PATCH Applied Dan Carpenter 2 participants 4 messages Jun 10, 2014 – Jun 18, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hello Inki Dae,

The patch df5225bc9a87: "drm/exynos: consider deferred probe case" from May 29, 2014, leads to the following static checker warning:

	drivers/gpu/drm/exynos/exynos_drm_fimd.c:996 fimd_probe()
	warn: 'ctx->display' isn't an ERR_PTR

drivers/gpu/drm/exynos/exynos_drm_fimd.c
994
995 ctx->display = exynos_dpi_probe(dev);
996 if (IS_ERR(ctx->display))
997 return PTR_ERR(ctx->display);
998

Smatch is complaining because my config has CONFIG_DRM_EXYNOS_DPI disabled.

1) If CONFIG_DRM_EXYNOS_DPI isn't enabled, we still return "0". That will cause a Sparse warning.

2) Also there are still a number of checks for "if (ctx->display)". Those things are weird to me, are those checks to see CONFIG_DRM_EXYNOS_DPI is enabled or are they checking that exynos_dpi_probe() succeeded?

regards,
dan carpenter

maintainer
#1 lore raw

Hello Dan,

Quoted 15 lines · Dan Carpenter

Hello Inki Dae,

The patch df5225bc9a87: "drm/exynos: consider deferred probe case" from May 29, 2014, leads to the following static checker warning:

	drivers/gpu/drm/exynos/exynos_drm_fimd.c:996 fimd_probe()
	warn: 'ctx->display' isn't an ERR_PTR

drivers/gpu/drm/exynos/exynos_drm_fimd.c
994

   995          ctx->display = exynos_dpi_probe(dev);
   996          if (IS_ERR(ctx->display))
   997                  return PTR_ERR(ctx->display);
   998  
Quoted 6 lines

Smatch is complaining because my config has CONFIG_DRM_EXYNOS_DPI disabled.

1) If CONFIG_DRM_EXYNOS_DPI isn't enabled, we still return "0". That will cause a Sparse warning.

It would be no problem. This code will return PTR_ERR(ctx->dislay) only in case that dpi module is enabled.

Quoted 5 lines

2) Also there are still a number of checks for "if (ctx->display)". Those things are weird to me, are those checks to see CONFIG_DRM_EXYNOS_DPI is enabled or are they checking that exynos_dpi_probe() succeeded?

Right. crtc driver, fimd, needs encoder/connector objects. In Exynos drm case, encoder/connector can be created by dpi module for parallel panel, by dsi module for mipi dsi based panel, or by dp module for eDP based panel.

So if some board has a parallel panel, encoder/connector objects will be created by dpi module, and then fimd module will refer to ctx->display object to control the parallel panel device. Otherwise, dsi or dp modules will create encoder/connector objects in its driver, and one of them will use its own display object to control corresponding panel device.

Thanks,
Inki Dae

Quoted 7 lines

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

PATCH 1/1 drm/exynos: change zero to NULL for sparse

We recently changed this function to return a pointer instead of an int so we need to change this zero to a NULL or Sparse complains:

	drivers/gpu/drm/exynos/exynos_drm_drv.h:346:47:
	warning: Using plain integer as NULL pointer
drivers/gpu/drm/exynos/exynos_drm_drv.h +1 -1
index 36535f3..06cde45 100644
@@ -343,7 +343,7 @@ struct exynos_drm_display * exynos_dpi_probe(struct device *dev);
 int exynos_dpi_remove(struct device *dev);
 #else
 static inline struct exynos_drm_display *
-exynos_dpi_probe(struct device *dev) { return 0; }
+exynos_dpi_probe(struct device *dev) { return NULL; }
 static inline int exynos_dpi_remove(struct device *dev) { return 0; }
 #endif
 
maintainer Applied
#3 lore raw

Re: [patch] drm/exynos: change zero to NULL for sparse

Quoted 5 lines · Dan Carpenter

We recently changed this function to return a pointer instead of an int so we need to change this zero to a NULL or Sparse complains:

	drivers/gpu/drm/exynos/exynos_drm_drv.h:346:47:
	warning: Using plain integer as NULL pointer

Applied.

Thanks,
Inki Dae

Quoted 21 lines
drivers/gpu/drm/exynos/exynos_drm_drv.h +1 -2
index 36535f3..06cde45 100644
@@ -343,7 +343,7 @@ struct exynos_drm_display * exynos_dpi_probe(struct device *dev);
 int exynos_dpi_remove(struct device *dev);
 #else
 static inline struct exynos_drm_display *
-exynos_dpi_probe(struct device *dev) { return 0; }
+exynos_dpi_probe(struct device *dev) { return NULL; }
 static inline int exynos_dpi_remove(struct device *dev) { return 0; }
 #endif
 
--

To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html