All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	od@zcrc.me, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Hulk Robot <hulkci@huawei.com>,
	YueHaibing <yuehaibing@huawei.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency
Date: Mon, 01 Jul 2019 14:34:07 +0200	[thread overview]
Message-ID: <1561984447.1999.0@crapouillou.net> (raw)
In-Reply-To: <20190701142847.1c1ac4b1@xps13>



Le lun. 1 juil. 2019 à 14:28, Miquel Raynal 
<miquel.raynal@bootlin.com> a écrit :
> Hi Paul,
> 
> One question below.
> 
> Paul Cercueil <paul@crapouillou.net> wrote on Sat, 29 Jun 2019 
> 03:22:48
> +0200:
> 
>>  If MTD_NAND_JZ4780 is y and MTD_NAND_JZ4780_BCH is m,
>>  which select CONFIG_MTD_NAND_INGENIC_ECC to m, building fails:
>> 
>>  drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
>> `ingenic_nand_remove':
>>  ingenic_nand.c:(.text+0x177): undefined reference to 
>> `ingenic_ecc_release'
>>  drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
>> `ingenic_nand_ecc_correct':
>>  ingenic_nand.c:(.text+0x2ee): undefined reference to 
>> `ingenic_ecc_correct'
>> 
>>  To fix that, the ingenic_nand and ingenic_ecc modules have been 
>> fused
>>  into one single module.
>>  - The ingenic_ecc.c code is now compiled in only if
>>    $(CONFIG_MTD_NAND_INGENIC_ECC) is set. This is now a boolean 
>> instead
>>    of tristate.
>>  - To avoid changing the module name, the ingenic_nand.c file is 
>> moved to
>>    ingenic_nand_drv.c. Then the module name is still ingenic_nand.
>>  - Since ingenic_ecc.c is no more a module, the module-specific 
>> macros
>>    have been dropped, and the functions are no more exported for use 
>> by
>>    the ingenic_nand driver.
> 
> I am fine with this approach.
> 
>> 
>>  Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and 
>> SoC specific code")
>>  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>  Reported-by: Arnd Bergmann <arnd@arndb.de>
>>  Reported-by: Hulk Robot <hulkci@huawei.com>
>>  Cc: YueHaibing <yuehaibing@huawei.com>
>>  Cc: stable@vger.kernel.org
>>  ---
>>   drivers/mtd/nand/raw/ingenic/Kconfig                     | 2 +-
>>   drivers/mtd/nand/raw/ingenic/Makefile                    | 4 +++-
>>   drivers/mtd/nand/raw/ingenic/ingenic_ecc.c               | 9 
>> ---------
>>   .../raw/ingenic/{ingenic_nand.c => ingenic_nand_drv.c}   | 0
>>   4 files changed, 4 insertions(+), 11 deletions(-)
>>   rename drivers/mtd/nand/raw/ingenic/{ingenic_nand.c => 
>> ingenic_nand_drv.c} (100%)
>> 
>>  diff --git a/drivers/mtd/nand/raw/ingenic/Kconfig 
>> b/drivers/mtd/nand/raw/ingenic/Kconfig
>>  index 19a96ce515c1..66b7cffdb0c2 100644
>>  --- a/drivers/mtd/nand/raw/ingenic/Kconfig
>>  +++ b/drivers/mtd/nand/raw/ingenic/Kconfig
>>  @@ -16,7 +16,7 @@ config MTD_NAND_JZ4780
>>   if MTD_NAND_JZ4780
>> 
>>   config MTD_NAND_INGENIC_ECC
>>  -	tristate
>>  +	bool
>> 
>>   config MTD_NAND_JZ4740_ECC
>>   	tristate "Hardware BCH support for JZ4740 SoC"
>>  diff --git a/drivers/mtd/nand/raw/ingenic/Makefile 
>> b/drivers/mtd/nand/raw/ingenic/Makefile
>>  index 1ac4f455baea..b63d36889263 100644
>>  --- a/drivers/mtd/nand/raw/ingenic/Makefile
>>  +++ b/drivers/mtd/nand/raw/ingenic/Makefile
>>  @@ -2,7 +2,9 @@
>>   obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o
>>   obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_nand.o
>> 
>>  -obj-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
>>  +ingenic_nand-y += ingenic_nand_drv.o
>>  +ingenic_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
>>  +
>>   obj-$(CONFIG_MTD_NAND_JZ4740_ECC) += jz4740_ecc.o
>>   obj-$(CONFIG_MTD_NAND_JZ4725B_BCH) += jz4725b_bch.o
>>   obj-$(CONFIG_MTD_NAND_JZ4780_BCH) += jz4780_bch.o
>>  diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c 
>> b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
>>  index d3e085c5685a..c954189606f6 100644
>>  --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
>>  +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
>>  @@ -30,7 +30,6 @@ int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
>>   {
>>   	return ecc->ops->calculate(ecc, params, buf, ecc_code);
>>   }
>>  -EXPORT_SYMBOL(ingenic_ecc_calculate);
>> 
>>   /**
>>    * ingenic_ecc_correct() - detect and correct bit errors
>>  @@ -51,7 +50,6 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
>>   {
>>   	return ecc->ops->correct(ecc, params, buf, ecc_code);
>>   }
>>  -EXPORT_SYMBOL(ingenic_ecc_correct);
>> 
>>   /**
>>    * ingenic_ecc_get() - get the ECC controller device
>>  @@ -111,7 +109,6 @@ struct ingenic_ecc *of_ingenic_ecc_get(struct 
>> device_node *of_node)
>>   	}
>>   	return ecc;
>>   }
>>  -EXPORT_SYMBOL(of_ingenic_ecc_get);
>> 
>>   /**
>>    * ingenic_ecc_release() - release the ECC controller device
>>  @@ -122,7 +119,6 @@ void ingenic_ecc_release(struct ingenic_ecc 
>> *ecc)
>>   	clk_disable_unprepare(ecc->clk);
>>   	put_device(ecc->dev);
>>   }
>>  -EXPORT_SYMBOL(ingenic_ecc_release);
>> 
>>   int ingenic_ecc_probe(struct platform_device *pdev)
>>   {
>>  @@ -159,8 +155,3 @@ int ingenic_ecc_probe(struct platform_device 
>> *pdev)
>>   	return 0;
>>   }
>>   EXPORT_SYMBOL(ingenic_ecc_probe);
> 
> Any reason to keep this one?

This one is called from the three ECC drivers, which can be modules,
so it still needs to be exported.

-Paul



WARNING: multiple messages have this Message-ID (diff)
From: Paul Cercueil <paul@crapouillou.net>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Richard Weinberger <richard@nod.at>,
	YueHaibing <yuehaibing@huawei.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Hulk Robot <hulkci@huawei.com>,
	od@zcrc.me, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency
Date: Mon, 01 Jul 2019 14:34:07 +0200	[thread overview]
Message-ID: <1561984447.1999.0@crapouillou.net> (raw)
In-Reply-To: <20190701142847.1c1ac4b1@xps13>



Le lun. 1 juil. 2019 à 14:28, Miquel Raynal 
<miquel.raynal@bootlin.com> a écrit :
> Hi Paul,
> 
> One question below.
> 
> Paul Cercueil <paul@crapouillou.net> wrote on Sat, 29 Jun 2019 
> 03:22:48
> +0200:
> 
>>  If MTD_NAND_JZ4780 is y and MTD_NAND_JZ4780_BCH is m,
>>  which select CONFIG_MTD_NAND_INGENIC_ECC to m, building fails:
>> 
>>  drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
>> `ingenic_nand_remove':
>>  ingenic_nand.c:(.text+0x177): undefined reference to 
>> `ingenic_ecc_release'
>>  drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
>> `ingenic_nand_ecc_correct':
>>  ingenic_nand.c:(.text+0x2ee): undefined reference to 
>> `ingenic_ecc_correct'
>> 
>>  To fix that, the ingenic_nand and ingenic_ecc modules have been 
>> fused
>>  into one single module.
>>  - The ingenic_ecc.c code is now compiled in only if
>>    $(CONFIG_MTD_NAND_INGENIC_ECC) is set. This is now a boolean 
>> instead
>>    of tristate.
>>  - To avoid changing the module name, the ingenic_nand.c file is 
>> moved to
>>    ingenic_nand_drv.c. Then the module name is still ingenic_nand.
>>  - Since ingenic_ecc.c is no more a module, the module-specific 
>> macros
>>    have been dropped, and the functions are no more exported for use 
>> by
>>    the ingenic_nand driver.
> 
> I am fine with this approach.
> 
>> 
>>  Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and 
>> SoC specific code")
>>  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>  Reported-by: Arnd Bergmann <arnd@arndb.de>
>>  Reported-by: Hulk Robot <hulkci@huawei.com>
>>  Cc: YueHaibing <yuehaibing@huawei.com>
>>  Cc: stable@vger.kernel.org
>>  ---
>>   drivers/mtd/nand/raw/ingenic/Kconfig                     | 2 +-
>>   drivers/mtd/nand/raw/ingenic/Makefile                    | 4 +++-
>>   drivers/mtd/nand/raw/ingenic/ingenic_ecc.c               | 9 
>> ---------
>>   .../raw/ingenic/{ingenic_nand.c => ingenic_nand_drv.c}   | 0
>>   4 files changed, 4 insertions(+), 11 deletions(-)
>>   rename drivers/mtd/nand/raw/ingenic/{ingenic_nand.c => 
>> ingenic_nand_drv.c} (100%)
>> 
>>  diff --git a/drivers/mtd/nand/raw/ingenic/Kconfig 
>> b/drivers/mtd/nand/raw/ingenic/Kconfig
>>  index 19a96ce515c1..66b7cffdb0c2 100644
>>  --- a/drivers/mtd/nand/raw/ingenic/Kconfig
>>  +++ b/drivers/mtd/nand/raw/ingenic/Kconfig
>>  @@ -16,7 +16,7 @@ config MTD_NAND_JZ4780
>>   if MTD_NAND_JZ4780
>> 
>>   config MTD_NAND_INGENIC_ECC
>>  -	tristate
>>  +	bool
>> 
>>   config MTD_NAND_JZ4740_ECC
>>   	tristate "Hardware BCH support for JZ4740 SoC"
>>  diff --git a/drivers/mtd/nand/raw/ingenic/Makefile 
>> b/drivers/mtd/nand/raw/ingenic/Makefile
>>  index 1ac4f455baea..b63d36889263 100644
>>  --- a/drivers/mtd/nand/raw/ingenic/Makefile
>>  +++ b/drivers/mtd/nand/raw/ingenic/Makefile
>>  @@ -2,7 +2,9 @@
>>   obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o
>>   obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_nand.o
>> 
>>  -obj-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
>>  +ingenic_nand-y += ingenic_nand_drv.o
>>  +ingenic_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
>>  +
>>   obj-$(CONFIG_MTD_NAND_JZ4740_ECC) += jz4740_ecc.o
>>   obj-$(CONFIG_MTD_NAND_JZ4725B_BCH) += jz4725b_bch.o
>>   obj-$(CONFIG_MTD_NAND_JZ4780_BCH) += jz4780_bch.o
>>  diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c 
>> b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
>>  index d3e085c5685a..c954189606f6 100644
>>  --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
>>  +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
>>  @@ -30,7 +30,6 @@ int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
>>   {
>>   	return ecc->ops->calculate(ecc, params, buf, ecc_code);
>>   }
>>  -EXPORT_SYMBOL(ingenic_ecc_calculate);
>> 
>>   /**
>>    * ingenic_ecc_correct() - detect and correct bit errors
>>  @@ -51,7 +50,6 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
>>   {
>>   	return ecc->ops->correct(ecc, params, buf, ecc_code);
>>   }
>>  -EXPORT_SYMBOL(ingenic_ecc_correct);
>> 
>>   /**
>>    * ingenic_ecc_get() - get the ECC controller device
>>  @@ -111,7 +109,6 @@ struct ingenic_ecc *of_ingenic_ecc_get(struct 
>> device_node *of_node)
>>   	}
>>   	return ecc;
>>   }
>>  -EXPORT_SYMBOL(of_ingenic_ecc_get);
>> 
>>   /**
>>    * ingenic_ecc_release() - release the ECC controller device
>>  @@ -122,7 +119,6 @@ void ingenic_ecc_release(struct ingenic_ecc 
>> *ecc)
>>   	clk_disable_unprepare(ecc->clk);
>>   	put_device(ecc->dev);
>>   }
>>  -EXPORT_SYMBOL(ingenic_ecc_release);
>> 
>>   int ingenic_ecc_probe(struct platform_device *pdev)
>>   {
>>  @@ -159,8 +155,3 @@ int ingenic_ecc_probe(struct platform_device 
>> *pdev)
>>   	return 0;
>>   }
>>   EXPORT_SYMBOL(ingenic_ecc_probe);
> 
> Any reason to keep this one?

This one is called from the three ECC drivers, which can be modules,
so it still needs to be exported.

-Paul



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

  reply	other threads:[~2019-07-01 12:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-29  1:22 [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency Paul Cercueil
2019-06-29  1:22 ` Paul Cercueil
2019-07-01 12:28 ` Miquel Raynal
2019-07-01 12:28   ` Miquel Raynal
2019-07-01 12:34   ` Paul Cercueil [this message]
2019-07-01 12:34     ` Paul Cercueil
2019-07-05 21:00 ` Miquel Raynal
2019-07-05 21:00   ` Miquel Raynal
  -- strict thread matches above, loose matches on Subject: below --
2019-06-17 11:10 [PATCH] mtd: rawnand: ingenic: fix " Arnd Bergmann
2019-06-17 11:10 ` Arnd Bergmann
2019-06-17 11:24 ` Paul Cercueil
2019-06-17 11:24   ` Paul Cercueil
2019-06-17 12:12   ` Arnd Bergmann
2019-06-17 12:12     ` Arnd Bergmann
2019-06-17 12:16     ` Miquel Raynal
2019-06-17 12:16       ` Miquel Raynal
2019-06-27 16:40       ` Miquel Raynal
2019-06-27 16:40         ` Miquel Raynal
2019-06-28 19:53         ` Paul Cercueil
2019-06-28 19:53           ` Paul Cercueil
2019-07-01 15:01           ` Arnd Bergmann
2019-07-01 15:01             ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1561984447.1999.0@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=arnd@arndb.de \
    --cc=hulkci@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=od@zcrc.me \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.