On Fri, Dec 21, 2012 at 02:53:51PM +0100, Lucas Stach wrote:
Am Freitag, den 21.12.2012, 13:39 +0200 schrieb Terje Bergstrom:
[...]
+void host1x_unregister_drm_device(struct host1x *host1x) +{
- if (host1x->drm_device)
platform_device_unregister(host1x->drm_device);
+} +EXPORT_SYMBOL(host1x_unregister_drm_device);
+struct platform_device *host1x_drm_device(struct platform_device *pdev) +{
- struct host1x *host = platform_get_drvdata(pdev);
- return host->drm_device;
+} +EXPORT_SYMBOL(host1x_drm_device);
This should be called host1x_get_drm_device
Or maybe even host1x_drm_get_device() to make it more obvious that it doesn't return a struct drm_device. Also I think it would be better to make it take a struct device * and return a struct device * instead. Users of the API will probably call this like so:
struct device *dummy = host1x_drm_get_device(pdev->dev.parent); struct drm_device *drm = dev_get_drvdata(dummy);
So we save ourselves some needless up-casting.
Thierry