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


Groups > linux.kernel > #1292983

Re: [PATCH] spi: Add builtin_spi_driver() to avoid registration boilerplate

From Paul Gortmaker <paul.gortmaker@windriver.com>
Newsgroups linux.kernel
Subject Re: [PATCH] spi: Add builtin_spi_driver() to avoid registration boilerplate
Date 2015-12-16 15:30 +0100
Message-ID <qGlfz-2SD-7@gated-at.bofh.it> (permalink)
References <qFlUn-4PZ-19@gated-at.bofh.it> <qGkjv-2hR-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[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 <module.h> to build.

Paul.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] spi: Add builtin_spi_driver() to avoid registration boilerplate Paul Gortmaker <paul.gortmaker@windriver.com> - 2015-12-13 22:00 +0100
  Re: [PATCH] spi: Add builtin_spi_driver() to avoid registration  boilerplate Mark Brown <broonie@kernel.org> - 2015-12-16 14:30 +0100
    Re: [PATCH] spi: Add builtin_spi_driver() to avoid registration  boilerplate Paul Gortmaker <paul.gortmaker@windriver.com> - 2015-12-16 15:30 +0100
      Re: [PATCH] spi: Add builtin_spi_driver() to avoid registration  boilerplate Mark Brown <broonie@kernel.org> - 2015-12-16 18:50 +0100

csiph-web