Skip to content

Commit fd57a33

Browse files
andy-shevAndi Shyti
authored andcommitted
i2c: designware: Move exports to I2C_DW namespaces
Reduce scope of the I²C DesignWare driver exports to I2C_DW namespaces. This will prevent abuse of the symbols and clean up global namespace. Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent 1bc7bb8 commit fd57a33

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

drivers/i2c/busses/i2c-designware-common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <linux/types.h>
2929
#include <linux/units.h>
3030

31+
#define DEFAULT_SYMBOL_NAMESPACE I2C_DW_COMMON
32+
3133
#include "i2c-designware-core.h"
3234

3335
static char *abort_sources[] = {

drivers/i2c/busses/i2c-designware-master.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <linux/regmap.h>
2323
#include <linux/reset.h>
2424

25+
#define DEFAULT_SYMBOL_NAMESPACE I2C_DW
26+
2527
#include "i2c-designware-core.h"
2628

2729
#define AMD_TIMEOUT_MIN_US 25
@@ -1037,3 +1039,4 @@ EXPORT_SYMBOL_GPL(i2c_dw_probe_master);
10371039

10381040
MODULE_DESCRIPTION("Synopsys DesignWare I2C bus master adapter");
10391041
MODULE_LICENSE("GPL");
1042+
MODULE_IMPORT_NS(I2C_DW_COMMON);

drivers/i2c/busses/i2c-designware-pcidrv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,3 +410,5 @@ module_pci_driver(dw_i2c_driver);
410410
MODULE_AUTHOR("Baruch Siach <[email protected]>");
411411
MODULE_DESCRIPTION("Synopsys DesignWare PCI I2C bus adapter");
412412
MODULE_LICENSE("GPL");
413+
MODULE_IMPORT_NS(I2C_DW);
414+
MODULE_IMPORT_NS(I2C_DW_COMMON);

drivers/i2c/busses/i2c-designware-platdrv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,3 +462,5 @@ module_exit(dw_i2c_exit_driver);
462462
MODULE_AUTHOR("Baruch Siach <[email protected]>");
463463
MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter");
464464
MODULE_LICENSE("GPL");
465+
MODULE_IMPORT_NS(I2C_DW);
466+
MODULE_IMPORT_NS(I2C_DW_COMMON);

drivers/i2c/busses/i2c-designware-slave.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <linux/pm_runtime.h>
1717
#include <linux/regmap.h>
1818

19+
#define DEFAULT_SYMBOL_NAMESPACE I2C_DW
20+
1921
#include "i2c-designware-core.h"
2022

2123
static void i2c_dw_configure_fifo_slave(struct dw_i2c_dev *dev)
@@ -279,3 +281,4 @@ EXPORT_SYMBOL_GPL(i2c_dw_probe_slave);
279281
MODULE_AUTHOR("Luis Oliveira <[email protected]>");
280282
MODULE_DESCRIPTION("Synopsys DesignWare I2C bus slave adapter");
281283
MODULE_LICENSE("GPL v2");
284+
MODULE_IMPORT_NS(I2C_DW_COMMON);

0 commit comments

Comments
 (0)