]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: create builtin_i2c_driver to avoid registration boilerplate
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 13 Dec 2015 20:33:19 +0000 (15:33 -0500)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 13 Jan 2016 10:06:03 +0000 (11:06 +0100)
commit0b26352f8660b61a4aa433d855a9edb1b2f56e24
tree02bd142f283819860018ec64910bf9c441d8df66
parent676a9f4686c95d44de39c12452427ab6cdc70d64
i2c: create builtin_i2c_driver to avoid registration boilerplate

In commit 517629972ab0c4c17b3549fff94bf67c4b8b0153 ("platform_device:
better support builtin boilerplate avoidance") we introduced the
builtin_driver macro.

Here we use that support and extend it to I2C driver registration,
so where a driver is clearly non-modular and builtin-only, we can
register it in a similar fashion.  And existing code that is clearly
non-modular can be updated with the simple mapping of

     module_i2c_driver(...)  ---> builtin_i2c_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.

A similar thing was done in commit 640b1fa3062c0269e83df5e90c454836a8e0fc64
("PCI: Add builtin_pci_driver() to avoid registration boilerplate").

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
include/linux/i2c.h