All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: mediatek: SCPSYS: use module_platform_driver
@ 2015-12-15 14:16 Sascha Hauer
  2015-12-15 14:30 ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2015-12-15 14:16 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/soc/mediatek/mtk-scpsys.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c
index e425619..e6752749 100644
--- a/drivers/soc/mediatek/mtk-scpsys.c
+++ b/drivers/soc/mediatek/mtk-scpsys.c
@@ -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);
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] soc: mediatek: SCPSYS: use module_platform_driver
  2015-12-15 14:16 [PATCH] soc: mediatek: SCPSYS: use module_platform_driver Sascha Hauer
@ 2015-12-15 14:30 ` Arnd Bergmann
  2015-12-15 15:42   ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2015-12-15 14:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 15 December 2015 15:16:06 Sascha Hauer wrote:
> @@ -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);
> 

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] soc: mediatek: SCPSYS: use module_platform_driver
  2015-12-15 14:30 ` Arnd Bergmann
@ 2015-12-15 15:42   ` Sascha Hauer
  2015-12-15 15:45     ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2015-12-15 15:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Dec 15, 2015 at 03:30:01PM +0100, Arnd Bergmann wrote:
> On Tuesday 15 December 2015 15:16:06 Sascha Hauer wrote:
> > @@ -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);
> > 
> 
> 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

-- 
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 |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] soc: mediatek: SCPSYS: use module_platform_driver
  2015-12-15 15:42   ` Sascha Hauer
@ 2015-12-15 15:45     ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2015-12-15 15:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 15 December 2015 16:42:03 Sascha Hauer wrote:
> On Tue, Dec 15, 2015 at 03:30:01PM +0100, Arnd Bergmann wrote:
> > On Tuesday 15 December 2015 15:16:06 Sascha Hauer wrote:
> > > @@ -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);
> > > 
> > 
> > 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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-15 15:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-15 14:16 [PATCH] soc: mediatek: SCPSYS: use module_platform_driver Sascha Hauer
2015-12-15 14:30 ` Arnd Bergmann
2015-12-15 15:42   ` Sascha Hauer
2015-12-15 15:45     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.