* [PATCH 1/2] mtd/rawnand: ingenic-ecc: Make probe function __init_or_module
@ 2019-06-07 16:01 Paul Cercueil
2019-06-07 16:02 ` [PATCH 2/2] mtd/rawnand: ingenic-nand: " Paul Cercueil
2019-06-08 10:22 ` [PATCH 1/2] mtd/rawnand: ingenic-ecc: " Paul Cercueil
0 siblings, 2 replies; 3+ messages in thread
From: Paul Cercueil @ 2019-06-07 16:01 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, David Woodhouse, Brian Norris,
Marek Vasut, Vignesh Raghavendra
Cc: od, linux-mtd, linux-kernel, Paul Cercueil
This allows the probe function to be dropped after the kernel finished
its initialization, in the case where the driver was not compiled as a
module.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/mtd/nand/raw/ingenic/ingenic_ecc.c | 2 +-
drivers/mtd/nand/raw/ingenic/ingenic_ecc.h | 3 ++-
drivers/mtd/nand/raw/ingenic/jz4780_bch.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
index d3e085c5685a..74eff8fb5d32 100644
--- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
+++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
@@ -124,7 +124,7 @@ void ingenic_ecc_release(struct ingenic_ecc *ecc)
}
EXPORT_SYMBOL(ingenic_ecc_release);
-int ingenic_ecc_probe(struct platform_device *pdev)
+int __init_or_module ingenic_ecc_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ingenic_ecc *ecc;
diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
index 2cda439b5e11..535eb8f29df6 100644
--- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
+++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
@@ -4,6 +4,7 @@
#include <linux/compiler_types.h>
#include <linux/err.h>
+#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/types.h>
#include <uapi/asm-generic/errno-base.h>
@@ -78,6 +79,6 @@ struct ingenic_ecc {
struct mutex lock;
};
-int ingenic_ecc_probe(struct platform_device *pdev);
+int __init_or_module ingenic_ecc_probe(struct platform_device *pdev);
#endif /* __DRIVERS_MTD_NAND_INGENIC_ECC_INTERNAL_H__ */
diff --git a/drivers/mtd/nand/raw/ingenic/jz4780_bch.c b/drivers/mtd/nand/raw/ingenic/jz4780_bch.c
index 079266a0d6cf..cc0656ac505d 100644
--- a/drivers/mtd/nand/raw/ingenic/jz4780_bch.c
+++ b/drivers/mtd/nand/raw/ingenic/jz4780_bch.c
@@ -229,7 +229,7 @@ static int jz4780_correct(struct ingenic_ecc *bch,
return ret;
}
-static int jz4780_bch_probe(struct platform_device *pdev)
+static int __init_or_module jz4780_bch_probe(struct platform_device *pdev)
{
struct ingenic_ecc *bch;
int ret;
--
2.21.0.593.g511ec345e18
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] mtd/rawnand: ingenic-nand: Make probe function __init_or_module
2019-06-07 16:01 [PATCH 1/2] mtd/rawnand: ingenic-ecc: Make probe function __init_or_module Paul Cercueil
@ 2019-06-07 16:02 ` Paul Cercueil
2019-06-08 10:22 ` [PATCH 1/2] mtd/rawnand: ingenic-ecc: " Paul Cercueil
1 sibling, 0 replies; 3+ messages in thread
From: Paul Cercueil @ 2019-06-07 16:02 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, David Woodhouse, Brian Norris,
Marek Vasut, Vignesh Raghavendra
Cc: od, linux-mtd, linux-kernel, Paul Cercueil
This allows the probe function to be dropped after the kernel finished
its initialization, in the case where the driver was not compiled as a
module.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/mtd/nand/raw/ingenic/ingenic_nand.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_nand.c b/drivers/mtd/nand/raw/ingenic/ingenic_nand.c
index d7b7c0f13909..b7f2facb4b37 100644
--- a/drivers/mtd/nand/raw/ingenic/ingenic_nand.c
+++ b/drivers/mtd/nand/raw/ingenic/ingenic_nand.c
@@ -302,7 +302,7 @@ static const struct nand_controller_ops ingenic_nand_controller_ops = {
.attach_chip = ingenic_nand_attach_chip,
};
-static int ingenic_nand_init_chip(struct platform_device *pdev,
+static int __init_or_module ingenic_nand_init_chip(struct platform_device *pdev,
struct ingenic_nfc *nfc,
struct device_node *np,
unsigned int chipnr)
@@ -399,7 +399,7 @@ static void ingenic_nand_cleanup_chips(struct ingenic_nfc *nfc)
}
}
-static int ingenic_nand_init_chips(struct ingenic_nfc *nfc,
+static int __init_or_module ingenic_nand_init_chips(struct ingenic_nfc *nfc,
struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -427,7 +427,7 @@ static int ingenic_nand_init_chips(struct ingenic_nfc *nfc,
return 0;
}
-static int ingenic_nand_probe(struct platform_device *pdev)
+static int __init_or_module ingenic_nand_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
unsigned int num_banks;
@@ -473,7 +473,7 @@ static int ingenic_nand_probe(struct platform_device *pdev)
return 0;
}
-static int ingenic_nand_remove(struct platform_device *pdev)
+static int __exit ingenic_nand_remove(struct platform_device *pdev)
{
struct ingenic_nfc *nfc = platform_get_drvdata(pdev);
--
2.21.0.593.g511ec345e18
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] mtd/rawnand: ingenic-ecc: Make probe function __init_or_module
2019-06-07 16:01 [PATCH 1/2] mtd/rawnand: ingenic-ecc: Make probe function __init_or_module Paul Cercueil
2019-06-07 16:02 ` [PATCH 2/2] mtd/rawnand: ingenic-nand: " Paul Cercueil
@ 2019-06-08 10:22 ` Paul Cercueil
1 sibling, 0 replies; 3+ messages in thread
From: Paul Cercueil @ 2019-06-08 10:22 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, David Woodhouse, Brian Norris,
Marek Vasut, Vignesh Raghavendra
Cc: od, linux-mtd, linux-kernel
I misunderstood what __init_or_module was for. Please ignore this
patchset. Sorry for the noise.
Le ven. 7 juin 2019 à 18:01, Paul Cercueil <paul@crapouillou.net> a
écrit :
> This allows the probe function to be dropped after the kernel finished
> its initialization, in the case where the driver was not compiled as a
> module.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
> drivers/mtd/nand/raw/ingenic/ingenic_ecc.c | 2 +-
> drivers/mtd/nand/raw/ingenic/ingenic_ecc.h | 3 ++-
> drivers/mtd/nand/raw/ingenic/jz4780_bch.c | 2 +-
> 3 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> index d3e085c5685a..74eff8fb5d32 100644
> --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> @@ -124,7 +124,7 @@ void ingenic_ecc_release(struct ingenic_ecc *ecc)
> }
> EXPORT_SYMBOL(ingenic_ecc_release);
>
> -int ingenic_ecc_probe(struct platform_device *pdev)
> +int __init_or_module ingenic_ecc_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct ingenic_ecc *ecc;
> diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
> b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
> index 2cda439b5e11..535eb8f29df6 100644
> --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
> +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
> @@ -4,6 +4,7 @@
>
> #include <linux/compiler_types.h>
> #include <linux/err.h>
> +#include <linux/module.h>
> #include <linux/mutex.h>
> #include <linux/types.h>
> #include <uapi/asm-generic/errno-base.h>
> @@ -78,6 +79,6 @@ struct ingenic_ecc {
> struct mutex lock;
> };
>
> -int ingenic_ecc_probe(struct platform_device *pdev);
> +int __init_or_module ingenic_ecc_probe(struct platform_device *pdev);
>
> #endif /* __DRIVERS_MTD_NAND_INGENIC_ECC_INTERNAL_H__ */
> diff --git a/drivers/mtd/nand/raw/ingenic/jz4780_bch.c
> b/drivers/mtd/nand/raw/ingenic/jz4780_bch.c
> index 079266a0d6cf..cc0656ac505d 100644
> --- a/drivers/mtd/nand/raw/ingenic/jz4780_bch.c
> +++ b/drivers/mtd/nand/raw/ingenic/jz4780_bch.c
> @@ -229,7 +229,7 @@ static int jz4780_correct(struct ingenic_ecc *bch,
> return ret;
> }
>
> -static int jz4780_bch_probe(struct platform_device *pdev)
> +static int __init_or_module jz4780_bch_probe(struct platform_device
> *pdev)
> {
> struct ingenic_ecc *bch;
> int ret;
> --
> 2.21.0.593.g511ec345e18
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-08 10:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 16:01 [PATCH 1/2] mtd/rawnand: ingenic-ecc: Make probe function __init_or_module Paul Cercueil
2019-06-07 16:02 ` [PATCH 2/2] mtd/rawnand: ingenic-nand: " Paul Cercueil
2019-06-08 10:22 ` [PATCH 1/2] mtd/rawnand: ingenic-ecc: " Paul Cercueil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).