mfd: sec: Export OF module alias table
Subsystems (3)
Krzysztof Kozlowski
maintainerPATCH 1/1 mfd: sec: Export OF module alias table
In case of Device Tree platforms, even though the Samsung PMIC sec device is instantiated from DT, the driver is still matched through I2C module alias. That is because I2C core always reports an I2C module alias instead of DT one.
This could change in the future so export DT module alias.
--- drivers/mfd/sec-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/mfd/sec-core.c +1 -0
@@ -146,6 +146,7 @@ static const struct of_device_id sec_dt_match[] = {/* Sentinel */ }, }; +MODULE_DEVICE_TABLE (of, sec_dt_match);#endif static bool s2mpa01_volatile (struct device *dev,unsigned int reg)
Signature · 1 line
2.14.1
Lee Jones
AppliedQuoted 11 lines · Krzysztof Kozlowski
In case of Device Tree platforms, even though the Samsung PMIC sec device is instantiated from DT, the driver is still matched through I2C module alias. That is because I2C core always reports an I2C module alias instead of DT one.
This could change in the future so export DT module alias.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/mfd/sec-core.c | 1 + 1 file changed, 1 insertion(+)
Applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Hi Krzysztof,
Quoted 5 lines · Krzysztof Kozlowski
In case of Device Tree platforms, even though the Samsung PMIC sec device is instantiated from DT, the driver is still matched through I2C module alias. That is because I2C core always reports an I2C module alias instead of DT one.
Just a heads up that this already changed in v4.17 since commit af503716ac1 ("i2c: core: report OF style module alias for devices registered via OF").
Quoted 12 lines
This could change in the future so export DT module alias.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/mfd/sec-core.c | 1 + 1 file changed, 1 insertion(+)drivers/mfd/sec-core.c +0
-0
drivers/mfd/sec-core.c static const struct of_device_id sec_dt_match[] = { · line 149
Quoted 4 lines
drivers/mfd/sec-core.c +1
-0@@ -146,6 +146,7 @@ static const struct of_device_id sec_dt_match[] = {/* Sentinel */ }, }; +MODULE_DEVICE_TABLE (of, sec_dt_match);
This driver can't be built as a module since its config symbol is bool, so technically this macro isn't needed. But it's a no-op when the driver is built-in so it's harmless to have it.
Best regards,
Javier
Krzysztof Kozlowski
maintainerQuoted 9 lines · Javier Martinez Canillas
Hi Krzysztof,
Quoted 5 lines · Krzysztof Kozlowski
In case of Device Tree platforms, even though the Samsung PMIC sec device is instantiated from DT, the driver is still matched through I2C module alias. That is because I2C core always reports an I2C module alias instead of DT one.
Quoted 3 lines
Just a heads up that this already changed in v4.17 since commit
af503716ac1("i2c: core: report OF style module alias for devices registered via OF").
True, I missed that part and blindly followed the old principle.
Quoted 8 lines
Quoted 8 lines
This could change in the future so export DT module alias.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/mfd/sec-core.c | 1 + 1 file changed, 1 insertion(+)
Quoted 13 lines
drivers/mfd/sec-core.c static const struct of_device_id sec_dt_match[] = { · line 149
Quoted 9 lines
drivers/mfd/sec-core.c +1
-0@@ -146,6 +146,7 @@ static const struct of_device_id sec_dt_match[] = {/* Sentinel */ }, }; +MODULE_DEVICE_TABLE (of, sec_dt_match);This driver can't be built as a module since its config symbol is bool, so technically this macro isn't needed. But it's a no-op when the driver is built-in so it's harmless to have it.
Indeed. I tried converting it to module but that does not work in all configurations (regulators are needed early).
Anyway my patch even though not that correct, it should not bring any issues.
Thanks for valuable feedback!
Best regards,
Krzysztof