Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1594703 > unrolled thread

Re: [PATCH v4 1/7] drm: Add DRM support for tiny LCD displays

Started byDaniel Vetter <daniel@ffwll.ch>
First post2017-03-07 23:30 +0100
Last post2017-03-08 13:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v4 1/7] drm: Add DRM support for tiny LCD displays Daniel Vetter <daniel@ffwll.ch> - 2017-03-07 23:30 +0100
    Re: [PATCH v4 1/7] drm: Add DRM support for tiny LCD displays Noralf Trønnes <noralf@tronnes.org> - 2017-03-08 13:30 +0100

#1594703 — Re: [PATCH v4 1/7] drm: Add DRM support for tiny LCD displays

FromDaniel Vetter <daniel@ffwll.ch>
Date2017-03-07 23:30 +0100
SubjectRe: [PATCH v4 1/7] drm: Add DRM support for tiny LCD displays
Message-ID<tivMe-5FM-17@gated-at.bofh.it>
On Sat, Feb 11, 2017 at 07:48:52PM +0100, Noralf Trønnes wrote:
> +const struct file_operations tinydrm_fops = {
> +	.owner		= THIS_MODULE,
> +	.open		= drm_open,
> +	.release	= drm_release,
> +	.unlocked_ioctl	= drm_ioctl,
> +#ifdef CONFIG_COMPAT
> +	.compat_ioctl	= drm_compat_ioctl,
> +#endif
> +	.poll		= drm_poll,
> +	.read		= drm_read,
> +	.llseek		= no_llseek,
> +	.mmap		= drm_gem_cma_mmap,
> +};
> +EXPORT_SYMBOL(tinydrm_fops);

Just spotted this while doing a drive-by refactoring, this doesn't really
work. The THIS_MODULE must be in the source code for your driver, and
can't be in some helper library module like tinydrm.ko.

I'm working on a macro to make this easier, and I guess you could try to
integrate that into your driver macro somehow (probably simplest to
generate the entire structure and just pass name+desc to that macro,
everything else is boilerplate anyway).

I'll cc you on that patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [next] | [standalone]


#1595109

FromNoralf Trønnes <noralf@tronnes.org>
Date2017-03-08 13:30 +0100
Message-ID<tiIT8-6v2-7@gated-at.bofh.it>
In reply to#1594703
Den 07.03.2017 23.21, skrev Daniel Vetter:
> On Sat, Feb 11, 2017 at 07:48:52PM +0100, Noralf Trønnes wrote:
>> +const struct file_operations tinydrm_fops = {
>> +	.owner		= THIS_MODULE,
>> +	.open		= drm_open,
>> +	.release	= drm_release,
>> +	.unlocked_ioctl	= drm_ioctl,
>> +#ifdef CONFIG_COMPAT
>> +	.compat_ioctl	= drm_compat_ioctl,
>> +#endif
>> +	.poll		= drm_poll,
>> +	.read		= drm_read,
>> +	.llseek		= no_llseek,
>> +	.mmap		= drm_gem_cma_mmap,
>> +};
>> +EXPORT_SYMBOL(tinydrm_fops);
> Just spotted this while doing a drive-by refactoring, this doesn't really
> work. The THIS_MODULE must be in the source code for your driver, and
> can't be in some helper library module like tinydrm.ko.

Yeah, you're right.

> I'm working on a macro to make this easier, and I guess you could try to
> integrate that into your driver macro somehow (probably simplest to
> generate the entire structure and just pass name+desc to that macro,
> everything else is boilerplate anyway).
>
> I'll cc you on that patch.

Thanks.

Noralf.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web