mfd: syscon: Removed support for unloading
Subsystems (2)
PATCH v2 1/3 mfd: syscon: Removed support for unloading
The driver can be used in various subsystems and therefore should not be unloaded when it is defined in the kernel configuration, so remove support for unloading it.
--- drivers/mfd/syscon.c | 18 ------------------ 1 file changed, 18 deletions(-)
drivers/mfd/syscon.c +0 -18
@@ -138,17 +138,6 @@ static int syscon_probe(struct platform_device *pdev)return 0 ; } -static int syscon_remove (struct platform_device *pdev) -{ -struct syscon *syscon; - - syscon =platform_get_drvdata (pdev); -iounmap (syscon->base); -platform_set_drvdata (pdev,NULL ); - -return 0 ; -} -static struct platform_driver syscon_driver = { .driver = { .name ="syscon" ,
@@ -156,7 +145,6 @@ static struct platform_driver syscon_driver = { .of_match_table = of_syscon_match, }, .probe = syscon_probe, - .remove = syscon_remove, };static int __init syscon_init (void )
@@ -165,12 +153,6 @@ static int __init syscon_init(void) }postcore_initcall (syscon_init); -static void __exit syscon_exit(void) -{ -platform_driver_unregister (&syscon_driver); -} -module_exit (syscon_exit); -MODULE_AUTHOR ("Dong Aisheng <[email protected]>" );MODULE_DESCRIPTION ("System Control driver" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
1.7.12.4
PATCH v2 2/3 mfd: syscon: Removed unneeded field "dev" from private driver structure
--- drivers/mfd/syscon.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mfd/syscon.c +1 -4
@@ -24,17 +24,15 @@static struct platform_driver syscon_driver;struct syscon { -struct device *dev;void __iomem *base;struct regmap *regmap; };static int syscon_match (struct device *dev,void *data) { -struct syscon *syscon =dev_get_drvdata (dev);struct device_node *dn = data; -return (syscon->dev->of_node == dn) ?1 :0 ; +return (dev->of_node == dn) ?1 :0 ; }struct regmap *syscon_node_to_regmap (struct device_node *np)
@@ -129,7 +127,6 @@ static int syscon_probe(struct platform_device *pdev)return PTR_ERR (syscon->regmap); } - syscon->dev = dev;platform_set_drvdata (pdev, syscon); dev_info(dev, "syscon regmap start 0x%x end 0x%x registered\n",
Signature · 1 line
1.7.12.4
Re: [PATCH v2 2/3] mfd: syscon: Removed unneeded field "dev" from private driver structure
Quoted 2 lines · Alexander Shiyan
Signed-off-by Alexander Shiyan <[email protected]>
Regards
Dong Aisheng
Quoted 38 lines
--- drivers/mfd/syscon.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/mfd/syscon.c +1
-5@@ -24,17 +24,15 @@static struct platform_driver syscon_driver;struct syscon { -struct device *dev;void __iomem *base;struct regmap *regmap; };static int syscon_match (struct device *dev,void *data) { -struct syscon *syscon =dev_get_drvdata (dev);struct device_node *dn = data; -return (syscon->dev->of_node == dn) ?1 :0 ; +return (dev->of_node == dn) ?1 :0 ; }struct regmap *syscon_node_to_regmap (struct device_node *np)@@ -129,7 +127,6 @@ static int syscon_probe(struct platform_device *pdev)return PTR_ERR (syscon->regmap); } - syscon->dev = dev;platform_set_drvdata (pdev, syscon); dev_info(dev, "syscon regmap start 0x%x end 0x%x registered\n", --1.7.12.4
PATCH v2 3/3 mfd: syscon: Add non-DT support
In reply to Alexander ShiyanThis patch allow using syscon driver from the platform data, i.e. possibility works without oftree support.
--- drivers/mfd/Kconfig | 1 - drivers/mfd/syscon.c | 77 ++++++++++++++++++++++++++++++++++------------ include/linux/mfd/syscon.h | 4 +++ 3 files changed, 62 insertions(+), 20 deletions(-)
drivers/mfd/Kconfig +0 -1
@@ -1070,7 +1070,6 @@ config MFD_STA2X11 config MFD_SYSCON bool "System Controller Register R/W Based on Regmap" - depends on OF select REGMAP_MMIO help Select this option to enable accessing system control registers
drivers/mfd/syscon.c +58 -19
134 lines not on this page · raw message
include/linux/mfd/syscon.h +4 -0
@@ -15,6 +15,10 @@#ifndef __LINUX_MFD_SYSCON_H__#define __LINUX_MFD_SYSCON_H__ +struct syscon_pdata { +const char *compatible; +}; +extern struct regmap *syscon_node_to_regmap (struct device_node *np);extern struct regmap *syscon_regmap_lookup_by_compatible (const char *s); extern struct regmap *syscon_regmap_lookup_by_phandle(
Signature · 1 line
1.7.12.4
Arnd Bergmann
maintainerQuoted 5 lines · Alexander Shiyan
The driver can be used in various subsystems and therefore should not be unloaded when it is defined in the kernel configuration, so remove support for unloading it.
Signed-off-by Alexander Shiyan <[email protected]>
Can you describe a scenario where that would happen? Normally the module should stay pinned as long as any other module refers to its exported symbols.
Arnd
Hello.
Quoted 10 lines · Alexander Shiyan
Quoted 5 lines
The driver can be used in various subsystems and therefore should not be unloaded when it is defined in the kernel configuration, so remove support for unloading it.
Signed-off-by Alexander Shiyan <[email protected]>Can you describe a scenario where that would happen? Normally the module should stay pinned as long as any other module refers to its exported symbols.
Probably I wrote a bad description.
The driver registered by "postcore_initcall". Therefore, if we unregister the driver, we have no way to register it back. Fixme please.
---
���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Arnd Bergmann
maintainerQuoted 7 lines · Alexander Shiyan
Quoted 7 lines · Alexander Shiyan
Quoted 5 lines
The driver can be used in various subsystems and therefore should not be unloaded when it is defined in the kernel configuration, so remove support for unloading it.
Signed-off-by Alexander Shiyan <[email protected]>
Quoted 7 lines
Quoted 3 lines
Can you describe a scenario where that would happen? Normally the module should stay pinned as long as any other module refers to its exported symbols.
Probably I wrote a bad description.
The driver registered by "postcore_initcall". Therefore, if we unregister the driver, we have no way to register it back. Fixme please.
Ah, the driver is actually "bool" in Kconfig rather than "tristate", so it is not possible to build it as a module. Makes sense then, and if we ever want to turn this into a module, we can still revert your patch.
Arnd
Quoted 5 lines · Alexander Shiyan
The driver can be used in various subsystems and therefore should not be unloaded when it is defined in the kernel configuration, so remove support for unloading it.
Signed-off-by Alexander Shiyan <[email protected]>
Regards
Dong Aisheng
Quoted 50 lines
--- drivers/mfd/syscon.c | 18 ------------------ 1 file changed, 18 deletions(-)drivers/mfd/syscon.c +0
-19@@ -138,17 +138,6 @@ static int syscon_probe(struct platform_device *pdev)return 0 ; } -static int syscon_remove (struct platform_device *pdev) -{ -struct syscon *syscon; - - syscon =platform_get_drvdata (pdev); -iounmap (syscon->base); -platform_set_drvdata (pdev,NULL ); - -return 0 ; -} -static struct platform_driver syscon_driver = { .driver = { .name ="syscon" ,@@ -156,7 +145,6 @@ static struct platform_driver syscon_driver = { .of_match_table = of_syscon_match, }, .probe = syscon_probe, - .remove = syscon_remove, };static int __init syscon_init (void )@@ -165,12 +153,6 @@ static int __init syscon_init(void) }postcore_initcall (syscon_init); -static void __exit syscon_exit(void) -{ -platform_driver_unregister (&syscon_driver); -} -module_exit (syscon_exit); -MODULE_AUTHOR ("Dong Aisheng <[email protected]>" );MODULE_DESCRIPTION ("System Control driver" );MODULE_LICENSE ("GPL v2" ); --1.7.12.4