Skip to contentSkip to conversation

finish modularization of ofpart parser

PATCH In review Dmitry Eremin-Solenikov 4 participants 12 messages Jun 26, 2011 – Jun 28, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover finish modularization of ofpart parser

To fix building of kernel if MTD is selected as a module and OF_PARTS is selected, finish modularization of ofpart MTD partition parser.

The following changes since commit 81e49819e7d6c11c91702d6b4d9fc71255614488:

mtd: spelling, capitalization, uniformity (2011-06-24 22:58:01 +0300)

are available in the git repository at:
git://git.infradead.org/users/dbaryshkov/mtd-cleanup.git mtd-big-cleanup

Dmitry Eremin-Solenikov (2):
mtd: make ofpart buildable as a separate module mtd/ofpart: add ofoldpart alias

 drivers/mtd/Kconfig  |    3 ++-
 drivers/mtd/Makefile |    2 +-
 drivers/mtd/ofpart.c |    3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#1 lore raw

PATCH 1/2 mtd: make ofpart buildable as a separate module

As ofpart now uses a standard mtd partitions parser interface, make it buildable as a separate module. Also provide MODULE_DESCRIPTION and MODULE_AUTHOR for this module.

---
 drivers/mtd/Kconfig  |    3 ++-
 drivers/mtd/Makefile |    2 +-
 drivers/mtd/ofpart.c |    2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)
drivers/mtd/Kconfig +2 -1
index 4be8373..cc02e21 100644
@@ -137,7 +137,8 @@ config MTD_AFS_PARTS
 	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
 
 config MTD_OF_PARTS
-	def_bool y
+	tristate "OpenFirmware partitioning information support"
+	default Y
 	depends on OF
 	help
 	  This provides a partition parsing function which derives
drivers/mtd/Makefile +1 -1
index 39664c4..9aaac3a 100644
@@ -5,8 +5,8 @@
 # Core functionality.
 obj-$(CONFIG_MTD)		+= mtd.o
 mtd-y				:= mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o
-mtd-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o
 
+obj-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o
 obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
 obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
 obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
drivers/mtd/ofpart.c +2 -0
index 41c4518..aa33b8a 100644
@@ -174,3 +174,5 @@ out:
 module_init(ofpart_parser_init);
 
 MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Parser for MTD partitioning information in device tree");
+MODULE_AUTHOR("Vitaly Wool, David Gibson");
Signature · 6 lines
1.7.5.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#4 lore raw

PATCH 2/2 mtd/ofpart: add ofoldpart alias

In reply to Dmitry Eremin-Solenikov

ofpart.ko also provides ofoldpart MTD parser. Add respective MODULE_ALIAS("ofoldpart"); declaration.

---
 drivers/mtd/ofpart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/mtd/ofpart.c +1 -0
index aa33b8a..c4b8d17 100644
@@ -176,3 +176,4 @@ module_init(ofpart_parser_init);
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Parser for MTD partitioning information in device tree");
 MODULE_AUTHOR("Vitaly Wool, David Gibson");
+MODULE_ALIAS("ofoldpart");
Signature · 6 lines
1.7.5.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] mtd: make ofpart buildable as a separate module

In reply to Dmitry Eremin-Solenikov
Quoted 5 lines · On Mon, 27 Jun 2011 01:02:59 +0400 Dmitry Eremin-Solenikov wrote:

As ofpart now uses a standard mtd partitions parser interface, make it buildable as a separate module. Also provide MODULE_DESCRIPTION and MODULE_AUTHOR for this module.

Thanks.

Quoted 40 lines
---
 drivers/mtd/Kconfig  |    3 ++-
 drivers/mtd/Makefile |    2 +-
 drivers/mtd/ofpart.c |    2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)
drivers/mtd/Kconfig +2 -1
index 4be8373..cc02e21 100644
@@ -137,7 +137,8 @@ config MTD_AFS_PARTS
 	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
 
 config MTD_OF_PARTS
-	def_bool y
+	tristate "OpenFirmware partitioning information support"
+	default Y
 	depends on OF
 	help
 	  This provides a partition parsing function which derives
drivers/mtd/Makefile +1 -1
index 39664c4..9aaac3a 100644
@@ -5,8 +5,8 @@
 # Core functionality.
 obj-$(CONFIG_MTD)		+= mtd.o
 mtd-y				:= mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o
-mtd-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o
 
+obj-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o
 obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
 obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
 obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
drivers/mtd/ofpart.c +0 -0
index 41c4518..aa33b8a 100644

drivers/mtd/ofpart.c out: · line 178

Quoted 5 lines
drivers/mtd/ofpart.c +2 -0
@@ -174,3 +174,5 @@ out:
 module_init(ofpart_parser_init);
 
 MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Parser for MTD partitioning information in device tree");
+MODULE_AUTHOR("Vitaly Wool, David Gibson");

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#5 lore raw

Re: [PATCH 2/2] mtd/ofpart: add ofoldpart alias

In reply to Dmitry Eremin-Solenikov
Quoted 4 lines · Dmitry Eremin-Solenikov

ofpart.ko also provides ofoldpart MTD parser. Add respective MODULE_ALIAS("ofoldpart"); declaration.

Is MODULE_ALIAS actually necessary for what is essentially a library module? I though MODULE_ALIAS was only needed to trigger loading a module for specific hardware. In this case, the module should be autoloaded when another module needs it. I may be misinformed though, my module-foo is a little rusty.

g.

Quoted 17 lines

---
 drivers/mtd/ofpart.c |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/mtd/ofpart.c +1 -1
index aa33b8a..c4b8d17 100644
@@ -176,3 +176,4 @@ module_init(ofpart_parser_init);
  MODULE_LICENSE("GPL");
  MODULE_DESCRIPTION("Parser for MTD partitioning information in device tree");
  MODULE_AUTHOR("Vitaly Wool, David Gibson");
+MODULE_ALIAS("ofoldpart");
--

1.7.5.4

Signature · 6 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#6 lore raw

Re: [PATCH 2/2] mtd/ofpart: add ofoldpart alias

In reply to Dmitry Eremin-Solenikov
Quoted 3 lines · Dmitry Eremin-Solenikov

ofpart.ko also provides ofoldpart MTD parser. Add respective MODULE_ALIAS("ofoldpart"); declaration.

Why we need the alias?

Signature · 2 lines
Best Regards,
Artem Bityutskiy
#3 lore raw

Re: [PATCH 1/2] mtd: make ofpart buildable as a separate module

In reply to Dmitry Eremin-Solenikov
Quoted 5 lines · Dmitry Eremin-Solenikov

As ofpart now uses a standard mtd partitions parser interface, make it buildable as a separate module. Also provide MODULE_DESCRIPTION and MODULE_AUTHOR for this module.

Pushed this one to l2-mtd-2.6.git, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy
#7 lore raw

Re: [PATCH 2/2] mtd/ofpart: add ofoldpart alias

In reply to Artem Bityutskiy
Quoted 6 lines · Artem Bityutskiy
Quoted 3 lines · Dmitry Eremin-Solenikov

ofpart.ko also provides ofoldpart MTD parser. Add respective MODULE_ALIAS("ofoldpart"); declaration.

Why we need the alias?

Please check the parse_mtd_partitions code. If requested parser isn't registered, it tries to load corresponding module. So, this alias is necessary in the semi-bogus case when one will have the list of parsers containing ofoldpart, but not ofpart partition parser.

Signature · 6 lines
With best wishes
Dmitry

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#8 lore raw

Re: [PATCH 2/2] mtd/ofpart: add ofoldpart alias

Quoted 6 lines · Dmitry Eremin-Solenikov
Quoted 5 lines · Artem Bityutskiy
Quoted 3 lines · Dmitry Eremin-Solenikov

ofpart.ko also provides ofoldpart MTD parser. Add respective MODULE_ALIAS("ofoldpart"); declaration.

Quoted 6 lines
Quoted 1 line

Why we need the alias?

Please check the parse_mtd_partitions code. If requested parser isn't registered, it tries to load corresponding module. So, this alias is necessary in the semi-bogus case when one will have the list of parsers containing ofoldpart, but not ofpart partition parser.

Fair enough, but would you please prepend MODULE_ALIAS with a comment like this which explains why we need the alias?

Signature · 2 lines
Best Regards,
Artem Bityutskiy
#9 lore raw

PATCH 2/2 mtd/ofpart: add ofoldpart alias

ofpart.ko also provides ofoldpart MTD parser. Add respective MODULE_ALIAS("ofoldpart"); declaration.

---
 drivers/mtd/ofpart.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/mtd/ofpart.c +3 -0
index aa33b8a..77f0640 100644
@@ -176,3 +176,6 @@ module_init(ofpart_parser_init);
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Parser for MTD partitioning information in device tree");
 MODULE_AUTHOR("Vitaly Wool, David Gibson");
+/* Required so that this module will be picked up ofoldpart
+ * MTD partition information parser */
+MODULE_ALIAS("ofoldpart");
Signature · 6 lines
1.7.5.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#10 lore raw

Re: [PATCH 2/2] mtd/ofpart: add ofoldpart alias

Quoted 13 lines · Dmitry Eremin-Solenikov

ofpart.ko also provides ofoldpart MTD parser. Add respective MODULE_ALIAS("ofoldpart"); declaration.

---
 drivers/mtd/ofpart.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/mtd/ofpart.c +0 -0
index aa33b8a..77f0640 100644

drivers/mtd/ofpart.c module_init(ofpart_parser_init); · line 181

Quoted 6 lines
drivers/mtd/ofpart.c +3 -0
@@ -176,3 +176,6 @@ module_init(ofpart_parser_init);
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Parser for MTD partitioning information in device tree");
 MODULE_AUTHOR("Vitaly Wool, David Gibson");
+/* Required so that this module will be picked up ofoldpart
+ * MTD partition information parser */
+MODULE_ALIAS("ofoldpart");

Well, the codyng style documents how multi-line comments should look like... And this comment is less readable than your previous explanation... But I've fixed this myself and pushed to my tree, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy
#11 lore raw

Re: [PATCH 2/2] mtd/ofpart: add ofoldpart alias

Quoted 9 lines · Artem Bityutskiy
Quoted 8 lines · Dmitry Eremin-Solenikov

ofpart.ko also provides ofoldpart MTD parser. Add respective MODULE_ALIAS("ofoldpart"); declaration.

---
 drivers/mtd/ofpart.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Quoted 16 lines

drivers/mtd/ofpart.c module_init(ofpart_parser_init); · line 181

Quoted 12 lines
drivers/mtd/ofpart.c +3 -0
index aa33b8a..77f0640 100644
@@ -176,3 +176,6 @@ module_init(ofpart_parser_init);
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Parser for MTD partitioning information in device
 tree");
 MODULE_AUTHOR("Vitaly Wool, David Gibson");
+/* Required so that this module will be picked up ofoldpart
+ * MTD partition information parser */
+MODULE_ALIAS("ofoldpart");

Well, the codyng style documents how multi-line comments should look like... And this comment is less readable than your previous explanation... But I've fixed this myself and pushed to my tree, thanks!

It seems I've got "All work and no play makes Jack a dull boy" sindrom...

Signature · 6 lines
With best wishes
Dmitry

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/