lkml.org 
[lkml]   [2012]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv4 8/8] gpu: host1x: Register DRM dummy device
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-12-21 15:41    [W:0.083 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site