Skip to contentSkip to conversation

soc: mediatek: SCPSYS: use module_platform_driver

PATCH New Sascha Hauer 2 participants 4 messages Dec 15, 2015 Arm MediaTek

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: mediatek: SCPSYS: use module_platform_driver

With regulator support to the scpsys driver needs to be able to defer probe. Probe deferral is incompatible with module_platform_driver_probe, so use -module_platform_driver.

---
 drivers/soc/mediatek/mtk-scpsys.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soc/mediatek/mtk-scpsys.c +2 -1
index e425619..e6752749 100644
@@ -542,6 +542,7 @@ static const struct of_device_id of_scpsys_match_tbl[] = {
 };
 
 static struct platform_driver scpsys_drv = {
+	.probe = scpsys_probe,
 	.driver = {
 		.name = "mtk-scpsys",
 		.owner = THIS_MODULE,
@@ -549,4 +550,4 @@ static struct platform_driver scpsys_drv = {
 	},
 };
 
-module_platform_driver_probe(scpsys_drv, scpsys_probe);
+module_platform_driver(scpsys_drv);
Signature · 1 line
2.6.2
#1 lore raw

PATCH 1/1 soc: mediatek: SCPSYS: use module_platform_driver

Quoted 10 lines · On Tuesday 15 December 2015 15:16:06 Sascha Hauer wrote:
drivers/soc/mediatek/mtk-scpsys.c +1 -0
@@ -542,6 +542,7 @@ static const struct of_device_id of_scpsys_match_tbl[] = {
 };
 
 static struct platform_driver scpsys_drv = {
+       .probe = scpsys_probe,
        .driver = {
                .name = "mtk-scpsys",
                .owner = THIS_MODULE,

drivers/soc/mediatek/mtk-scpsys.c static struct platform_driver scpsys_drv = { · line 553

Quoted 5 lines
drivers/soc/mediatek/mtk-scpsys.c +1 -1
@@ -549,4 +550,4 @@ static struct platform_driver scpsys_drv = {
        },
 };
 
-module_platform_driver_probe(scpsys_drv, scpsys_probe);
+module_platform_driver(scpsys_drv);

Good idea, but I wonder why there is no remove function in the driver. Do we also need to make the module non-removable and set .suppress_bind_attrs, or is all of the probe function reversible through devm_* helpers?

Arnd

#2 lore raw

PATCH 1/1 soc: mediatek: SCPSYS: use module_platform_driver

Quoted 13 lines · Arnd Bergmann
Quoted 12 lines · On Tuesday 15 December 2015 15:16:06 Sascha Hauer wrote:
drivers/soc/mediatek/mtk-scpsys.c +1 -0
@@ -542,6 +542,7 @@ static const struct of_device_id of_scpsys_match_tbl[] = {
 };
 
 static struct platform_driver scpsys_drv = {
+       .probe = scpsys_probe,
        .driver = {
                .name = "mtk-scpsys",
                .owner = THIS_MODULE,
@@ -549,4 +550,4 @@ static struct platform_driver scpsys_drv = {
        },
 };
 
Quoted 8 lines

drivers/soc/mediatek/mtk-scpsys.c static struct platform_driver scpsys_drv = { · line 553

Quoted 3 lines
drivers/soc/mediatek/mtk-scpsys.c +1 -1
-module_platform_driver_probe(scpsys_drv, scpsys_probe);
+module_platform_driver(scpsys_drv);

Good idea, but I wonder why there is no remove function in the driver. Do we also need to make the module non-removable and set .suppress_bind_attrs, or is all of the probe function reversible through devm_* helpers?

pm domains currently can't be unregistered, removal of this driver is not supported. The driver can't be compiled as a module.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#3 lore raw

PATCH 1/1 soc: mediatek: SCPSYS: use module_platform_driver

Quoted 23 lines · On Tuesday 15 December 2015 16:42:03 Sascha Hauer wrote:
Quoted 13 lines · Arnd Bergmann
Quoted 12 lines · On Tuesday 15 December 2015 15:16:06 Sascha Hauer wrote:
drivers/soc/mediatek/mtk-scpsys.c +1 -0
@@ -542,6 +542,7 @@ static const struct of_device_id of_scpsys_match_tbl[] = {
 };
 
 static struct platform_driver scpsys_drv = {
+       .probe = scpsys_probe,
        .driver = {
                .name = "mtk-scpsys",
                .owner = THIS_MODULE,
@@ -549,4 +550,4 @@ static struct platform_driver scpsys_drv = {
        },
 };
 
Quoted 8 lines

drivers/soc/mediatek/mtk-scpsys.c static struct platform_driver scpsys_drv = { · line 553

Quoted 3 lines
drivers/soc/mediatek/mtk-scpsys.c +1 -1
-module_platform_driver_probe(scpsys_drv, scpsys_probe);
+module_platform_driver(scpsys_drv);

Good idea, but I wonder why there is no remove function in the driver. Do we also need to make the module non-removable and set .suppress_bind_attrs, or is all of the probe function reversible through devm_* helpers?

Quoted 2 lines

pm domains currently can't be unregistered, removal of this driver is not supported. The driver can't be compiled as a module.

Ok, then you need the suppress_bind_attrs flag to ensure that users cannot unbind and rebind the device through sysfs. The module_exit() function will be dropped implicitly for built-in drivers, so the module_platform_driver() is ok.

Arnd