Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753684AbcD1KBL (ORCPT ); Thu, 28 Apr 2016 06:01:11 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:59783 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753400AbcD1KBI (ORCPT ); Thu, 28 Apr 2016 06:01:08 -0400 From: Arnd Bergmann To: Sagar Dharia Cc: gregkh@linuxfoundation.org, bp@suse.de, poeschel@lemonage.de, treding@nvidia.com, broonie@kernel.org, gong.chen@linux.intel.com, andreas.noever@gmail.com, alan@linux.intel.com, mathieu.poirier@linaro.org, daniel@ffwll.ch, jkosina@suse.cz, sharon.dvir1@mail.huji.ac.il, joe@perches.com, davem@davemloft.net, james.hogan@imgtec.com, michael.opdenacker@free-electrons.com, daniel.thompson@linaro.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kheitke@audience.com, mlocke@codeaurora.org, agross@codeaurora.org, sheetal.tigadoli@gmail.com, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH V5 1/6] SLIMbus: Device management on SLIMbus Date: Thu, 28 Apr 2016 12:00:26 +0200 Message-ID: <2692115.H6acsZmTjn@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1461801489-16254-2-git-send-email-sdharia@codeaurora.org> References: <1461801489-16254-1-git-send-email-sdharia@codeaurora.org> <1461801489-16254-2-git-send-email-sdharia@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:jK0oywxUFyQPj4eYUtHz8DbKEpY39Z2TpdXkyT8+Wsjne1B4xRH 5pqLGw1EqY5wXHFRDudtmga0R8WoMincyiY65RJIpetNMAIYDkZbaZYZn++Ju6suJMBo7lq 2DNHz1OY0pd90onJ6VXMbni8nargeugagjZKaBXE+JLx1BP76eAlwKHkYH10b/D+iP5kSpA FW1o+C8ypoIBMzVICusCw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Qe2CR+JkdCg=:l980b5vkAZ+Y56sv3JwBtD G97aYKRl6wQDPFd1N6f4tu+ExNAbmWJxzItl/tUUfEzl4u5rtzi1DG80GfTVNGlOP80nfrGqU 1622ozcKzWNL0cZQpC4aRWKCXsc0jE5cYWeP+SqpxG+SRCsVsrEFkPfvN79ahTfHCB/OfsJ8K EUke8zKbYg+sJyv5TIlMFGXIopojD9rUH3a+nd7/3k4B5jsKh1QwaklBi5Z2IBkF6WNX07tr4 wx2tPyHT6nm/tmBeQ2dm8EF6r5Fqd0AjyM5OaIE2EbD297/eHBCeNQME2jMoqkAuufGpFulY6 gB0NXnj6gKAtyUp5eZtU+V8dAgPfaYyZ7VCHJzQrSCxVbPdQvf55uJiwE7Ym6yGBjwXd5PLDl VFMgOF/pGuymeT/EnsqhwuFzChTPj5UECiwYaVgEQ037r3gbCf6+2Y9K9+kWe9iphQw1dhjbk nSnDat4uBr8/U8gy2r/6y4CYjMwlYD37SFVbNOxvG30zIMLYV/n+anfEHVMNfckp4yKGi+F+E XUroUd+OB4SPyPM1JiQ6rW4KhKjomT4WkKKDyGl5TPYc4/4edE9ai5pdUcFUKpP7pocwXbFiP uSh6TpH9kpuCjtBgqLPb+1/dnjN8MydDR/vep5t5BkuksMdT07mISmTjb9DQWI+tsvTjN/b4c dMukVpzLq0rM/9fNrDsioJNVpQpryJsFW6GCOOKbRUE5uuOkuTS2RyN7lcn8J5oP6w2NNA9Y2 JZyfntZVyH0lXG+T Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2134 Lines: 66 On Wednesday 27 April 2016 17:58:04 Sagar Dharia wrote: > +/** > + * slim_driver_register: Client driver registration with slimbus > + * @drv:Client driver to be associated with client-device. > + * This API will register the client driver with the slimbus > + * It is called from the driver's module-init function. > + */ > +int slim_driver_register(struct slim_driver *drv) > +{ > + drv->driver.bus = &slimbus_type; > + > + return driver_register(&drv->driver); > +} > +EXPORT_SYMBOL_GPL(slim_driver_register); Please make this use the same trick as platform_driver_register() to implicitly set the .owner field of the driver to THIS_MODULE. > +/** > + * slim_add_device: Add a new device without register board info. > + * @ctrl: Controller to which this device is to be added to. > + * Called when device doesn't have an explicit client-driver to be probed, or > + * the client-driver is a module installed dynamically. > + */ > +int slim_add_device(struct slim_controller *ctrl, struct slim_device *sbdev) This looks like an artifact of ancient pre-DT times. I'd say kill it off before someone starts using it. > +struct sbi_boardinfo { > + struct list_head list; > + struct slim_boardinfo board_info; > +}; > + > +static LIST_HEAD(board_list); > +static LIST_HEAD(slim_ctrl_list); > +static DEFINE_MUTEX(board_lock); > + > +/** > + * slim_register_board_info: Board-initialization routine. > + * @info: List of all devices on all controllers present on the board. > + * @n: number of entries. > + * API enumerates respective devices on corresponding controller. > + * Called from board-init function. > + */ > +int slim_register_board_info(struct slim_boardinfo const *info, unsigned n) > +{ Same for all of this. > +struct slim_device_id { > + __u16 manf_id, prod_code; > + __u8 dev_index, instance; > + > + /* Data private to the driver */ > + kernel_ulong_t driver_data; > +}; Can you add explicit padding here to avoid having the anonymous two bytes in the middle? Also, I think a void pointer instead of a kernel_ulong_t makes it more useful, but there are always cases where one or the other fits better. Arnd