From: Fabio Estevam <festevam@gmail.com>
To: artem.bityutskiy@linux.intel.com
Cc: marex@denx.de, b32955@freescale.com,
linux-mtd@lists.infradead.org,
Fabio Estevam <fabio.estevam@freescale.com>,
kernel@pengutronix.de
Subject: [PATCH 2/2] mtd: mxc_nand: Convert to platform driver
Date: Wed, 5 Sep 2012 11:35:25 -0300 [thread overview]
Message-ID: <1346855725-31726-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1346855725-31726-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
Using module_platform_driver() makes the code smaller and cleaner.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/mtd/nand/mxc_nand.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index e59a45f..cc8b1e1 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1389,7 +1389,7 @@ static int __init mxcnd_probe_pdata(struct mxc_nand_host *host)
return 0;
}
-static int __init mxcnd_probe(struct platform_device *pdev)
+static int __devinit mxcnd_probe(struct platform_device *pdev)
{
struct nand_chip *this;
struct mtd_info *mtd;
@@ -1581,22 +1581,10 @@ static struct platform_driver mxcnd_driver = {
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(mxcnd_dt_ids),
},
+ .probe = mxcnd_probe,
.remove = __devexit_p(mxcnd_remove),
};
-
-static int __init mxc_nd_init(void)
-{
- return platform_driver_probe(&mxcnd_driver, mxcnd_probe);
-}
-
-static void __exit mxc_nd_cleanup(void)
-{
- /* Unregister the device structure */
- platform_driver_unregister(&mxcnd_driver);
-}
-
-module_init(mxc_nd_init);
-module_exit(mxc_nd_cleanup);
+module_platform_driver(mxcnd_driver);
MODULE_AUTHOR("Freescale Semiconductor, Inc.");
MODULE_DESCRIPTION("MXC NAND MTD driver");
--
1.7.9.5
next prev parent reply other threads:[~2012-09-05 14:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 14:35 [PATCH 1/2] mtd: gpmi-nand: Convert to platform driver Fabio Estevam
2012-09-05 14:35 ` Fabio Estevam [this message]
2012-09-15 13:33 ` [PATCH 2/2] mtd: mxc_nand: " Fabio Estevam
2012-09-05 18:55 ` [PATCH 1/2] mtd: gpmi-nand: " Marek Vasut
2012-09-05 19:00 ` Fabio Estevam
2012-09-05 19:23 ` Marek Vasut
2012-09-05 19:51 ` Fabio Estevam
2012-09-21 12:19 ` Fabio Estevam
2012-09-21 12:53 ` Marek Vasut
2012-09-22 14:59 ` Artem Bityutskiy
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=1346855725-31726-2-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=artem.bityutskiy@linux.intel.com \
--cc=b32955@freescale.com \
--cc=fabio.estevam@freescale.com \
--cc=kernel@pengutronix.de \
--cc=linux-mtd@lists.infradead.org \
--cc=marex@denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox