Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752940AbdCHMYs (ORCPT ); Wed, 8 Mar 2017 07:24:48 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:53579 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbdCHMYb (ORCPT ); Wed, 8 Mar 2017 07:24:31 -0500 Subject: Re: [PATCH v4 1/7] drm: Add DRM support for tiny LCD displays To: Daniel Vetter References: <20170211184858.26421-1-noralf@tronnes.org> <20170211184858.26421-2-noralf@tronnes.org> <20170307222108.ofhnyrzs2bnbhqt5@phenom.ffwll.local> Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, thomas.petazzoni@free-electrons.com, linux-kernel@vger.kernel.org From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= Message-ID: <46f54cb0-4019-8b40-5a0b-43ca100a4a78@tronnes.org> Date: Wed, 8 Mar 2017 13:23:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170307222108.ofhnyrzs2bnbhqt5@phenom.ffwll.local> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1032 Lines: 33 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.