2011-06-26 21:05:20

by Dmitry Baryshkov

[permalink] [raw]
Subject: [PATCH 0/2] 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(-)


2011-06-26 21:05:32

by Dmitry Baryshkov

[permalink] [raw]
Subject: [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.

Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
---
drivers/mtd/Kconfig | 3 ++-
drivers/mtd/Makefile | 2 +-
drivers/mtd/ofpart.c | 2 ++
3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 4be8373..cc02e21 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -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
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 39664c4..9aaac3a 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -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
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 41c4518..aa33b8a 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -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");
--
1.7.5.4

2011-06-26 21:05:37

by Dmitry Baryshkov

[permalink] [raw]
Subject: [PATCH 2/2] mtd/ofpart: add ofoldpart alias

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

Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
---
drivers/mtd/ofpart.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index aa33b8a..c4b8d17 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -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

2011-06-26 23:30:33

by Randy Dunlap

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

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.
>
> Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>

Acked-by: Randy Dunlap <[email protected]>

Thanks.

> ---
> drivers/mtd/Kconfig | 3 ++-
> drivers/mtd/Makefile | 2 +-
> drivers/mtd/ofpart.c | 2 ++
> 3 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
> index 4be8373..cc02e21 100644
> --- a/drivers/mtd/Kconfig
> +++ b/drivers/mtd/Kconfig
> @@ -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
> diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
> index 39664c4..9aaac3a 100644
> --- a/drivers/mtd/Makefile
> +++ b/drivers/mtd/Makefile
> @@ -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
> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
> index 41c4518..aa33b8a 100644
> --- a/drivers/mtd/ofpart.c
> +++ b/drivers/mtd/ofpart.c
> @@ -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 ***

2011-06-26 23:36:55

by Grant Likely

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

On Sun, Jun 26, 2011 at 3:03 PM, Dmitry Eremin-Solenikov
<[email protected]> wrote:
> ofpart.ko also provides ofoldpart MTD parser. Add respective
> MODULE_ALIAS("ofoldpart"); declaration.
>
> Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>

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.

> ---
> ?drivers/mtd/ofpart.c | ? ?1 +
> ?1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
> index aa33b8a..c4b8d17 100644
> --- a/drivers/mtd/ofpart.c
> +++ b/drivers/mtd/ofpart.c
> @@ -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
>
>



--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

2011-06-27 05:45:11

by Artem Bityutskiy

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

On Mon, 2011-06-27 at 01:03 +0400, Dmitry Eremin-Solenikov wrote:
> ofpart.ko also provides ofoldpart MTD parser. Add respective
> MODULE_ALIAS("ofoldpart"); declaration.
>

Why we need the alias?

--
Best Regards,
Artem Bityutskiy

2011-06-27 05:49:01

by Artem Bityutskiy

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

On Mon, 2011-06-27 at 01:02 +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.
>
> Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>

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

--
Best Regards,
Artem Bityutskiy

2011-06-27 05:53:38

by Dmitry Baryshkov

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

On 6/27/11, Artem Bityutskiy <[email protected]> wrote:
> On Mon, 2011-06-27 at 01:03 +0400, Dmitry Eremin-Solenikov wrote:
>> 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.

--
With best wishes
Dmitry

2011-06-27 06:05:55

by Artem Bityutskiy

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

On Mon, 2011-06-27 at 09:51 +0400, Dmitry Eremin-Solenikov wrote:
> On 6/27/11, Artem Bityutskiy <[email protected]> wrote:
> > On Mon, 2011-06-27 at 01:03 +0400, Dmitry Eremin-Solenikov wrote:
> >> 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.

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

--
Best Regards,
Artem Bityutskiy

2011-06-27 12:36:23

by Dmitry Baryshkov

[permalink] [raw]
Subject: [PATCH 2/2] mtd/ofpart: add ofoldpart alias

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

Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
---
drivers/mtd/ofpart.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index aa33b8a..77f0640 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -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");
--
1.7.5.4

2011-06-28 07:41:51

by Artem Bityutskiy

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

On Mon, 2011-06-27 at 16:34 +0400, Dmitry Eremin-Solenikov wrote:
> ofpart.ko also provides ofoldpart MTD parser. Add respective
> MODULE_ALIAS("ofoldpart"); declaration.
>
> Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
> ---
> drivers/mtd/ofpart.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
> index aa33b8a..77f0640 100644
> --- a/drivers/mtd/ofpart.c
> +++ b/drivers/mtd/ofpart.c
> @@ -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!

--
Best Regards,
Artem Bityutskiy

2011-06-28 08:12:51

by Dmitry Baryshkov

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

On 6/28/11, Artem Bityutskiy <[email protected]> wrote:
> On Mon, 2011-06-27 at 16:34 +0400, Dmitry Eremin-Solenikov wrote:
>> ofpart.ko also provides ofoldpart MTD parser. Add respective
>> MODULE_ALIAS("ofoldpart"); declaration.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
>> ---
>> drivers/mtd/ofpart.c | 3 +++
>> 1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
>> index aa33b8a..77f0640 100644
>> --- a/drivers/mtd/ofpart.c
>> +++ b/drivers/mtd/ofpart.c
>> @@ -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...

--
With best wishes
Dmitry