From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933048AbbLPOVX (ORCPT ); Wed, 16 Dec 2015 09:21:23 -0500 Received: from mail1.windriver.com ([147.11.146.13]:39348 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161AbbLPOVV convert rfc822-to-8bit (ORCPT ); Wed, 16 Dec 2015 09:21:21 -0500 Date: Wed, 16 Dec 2015 09:21:17 -0500 From: Paul Gortmaker To: Mark Brown CC: , Subject: Re: [PATCH] spi: Add builtin_spi_driver() to avoid registration boilerplate Message-ID: <20151216142117.GL2772@windriver.com> References: <1450040037-28334-1-git-send-email-paul.gortmaker@windriver.com> <20151216132357.GK5727@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20151216132357.GK5727@sirena.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Re: [PATCH] spi: Add builtin_spi_driver() to avoid registration boilerplate] On 16/12/2015 (Wed 13:23) Mark Brown wrote: > On Sun, Dec 13, 2015 at 03:53:57PM -0500, Paul Gortmaker wrote: > > > Here we use that support and extend it to SPI driver registration, so where > > a driver is clearly non-modular and builtin-only, we can register it in a > > similar fashion. Existing code that is clearly non-modular can be updated > > with the simple mapping of > > > module_spi_driver(...) ---> builtin_spi_driver(...) > > > We've essentially cloned the former to make the latter, and taken out the > > remove/module_exit parts since those never get used in a non-modular build > > of the code. > > Why would it be sensible to have a SPI driver that can't be built as a > module? Looking at the existing use case - in: drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c it would appear that the SPI driver is embedded within another driver that the author decided to make non-modular. Others that don't actually use the module_spi_driver macro but are also non modular are drivers/mfd wm831x-spi.c and stmpe-spi.c -- I'm guessing based on the above that you will suggest we convert those to tristate. At a more general level, if we have provided infrastructural helpers like module_xyz() then it seems sensible IMHO to have the parallel equivalent of builtin_xyz() so that we don't force non-modular code to require an include of to build. Paul. --