Skip to contentSkip to conversation

mfd: sec: Export OF module alias table

PATCH Applied Krzysztof Kozlowski 3 participants 4 messages Jul 25, 2018 – Aug 7, 2018

Subsystems (3)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 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
index ca6b80d08ffc..9613b4257302 100644
@@ -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
Applied
#1 lore raw
Quoted 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.

---
 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
#2 lore raw
In reply to Krzysztof Kozlowski

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.

---
 drivers/mfd/sec-core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/sec-core.c +0 -0
index ca6b80d08ffc..9613b4257302 100644

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

author maintainer
#3 lore raw
Quoted 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.

---
 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
index ca6b80d08ffc..9613b4257302 100644
@@ -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