]> 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)
commitaf6467a90ffd52b0752b948631d33990cd66eafb
tree02bd142f283819860018ec64910bf9c441d8df66
parent5cf97c6c217b101b88b59e7212179cad2da2e661
i2c: create builtin_i2c_driver to avoid registration boilerplate

In commit 423b0af1630200382e0ba443e17cb013e6ae46f7 ("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 e2b25e13679d8247773cf61470e157ce30534e36
("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