atheros: ar2315-spiflash: update initialization

- fill module metadata
  - remove odd module_{init,exit}

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42490 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
John Crispin 2014-09-12 06:51:51 +00:00
parent 0dcf34e7f4
commit 5471f2816d
1 changed files with 12 additions and 23 deletions

View File

@ -23,7 +23,7 @@
--- /dev/null --- /dev/null
+++ b/drivers/mtd/devices/ar2315.c +++ b/drivers/mtd/devices/ar2315.c
@@ -0,0 +1,518 @@ @@ -0,0 +1,507 @@
+ +
+/* +/*
+ * MTD driver for the SPI Flash Memory support on Atheros AR2315 + * MTD driver for the SPI Flash Memory support on Atheros AR2315
@ -56,8 +56,8 @@
+ +
+#include "ar2315_spiflash.h" +#include "ar2315_spiflash.h"
+ +
+#define DRIVER_NAME "ar2315-spiflash"
+ +
+#define SPIFLASH "spiflash: "
+#define busy_wait(_priv, _condition, _wait) do { \ +#define busy_wait(_priv, _condition, _wait) do { \
+ while (_condition) { \ + while (_condition) { \
+ spin_unlock_bh(&_priv->lock); \ + spin_unlock_bh(&_priv->lock); \
@ -227,7 +227,7 @@
+ * and flashconfig_tbl array index for success. + * and flashconfig_tbl array index for success.
+ */ + */
+static int +static int
+spiflash_probe_chip(struct spiflash_priv *priv) +spiflash_probe_chip(struct platform_device *pdev, struct spiflash_priv *priv)
+{ +{
+ u32 sig; + u32 sig;
+ int flash_size; + int flash_size;
@ -254,7 +254,7 @@
+ flash_size = FLASH_16MB; + flash_size = FLASH_16MB;
+ break; + break;
+ default: + default:
+ pr_warn(SPIFLASH "Read of flash device signature failed!\n"); + dev_warn(&pdev->dev, "read of flash device signature failed!\n");
+ return 0; + return 0;
+ } + }
+ +
@ -468,9 +468,9 @@
+ return PTR_ERR(priv->mmraddr); + return PTR_ERR(priv->mmraddr);
+ } + }
+ +
+ index = spiflash_probe_chip(priv); + index = spiflash_probe_chip(pdev, priv);
+ if (!index) { + if (!index) {
+ dev_warn(&pdev->dev, SPIFLASH "Found no flash device\n"); + dev_warn(&pdev->dev, "found no flash device\n");
+ return -ENODEV; + return -ENODEV;
+ } + }
+ +
@ -518,29 +518,18 @@
+} +}
+ +
+static struct platform_driver spiflash_driver = { +static struct platform_driver spiflash_driver = {
+ .driver.name = "ar2315-spiflash", + .driver.name = DRIVER_NAME,
+ .probe = spiflash_probe, + .probe = spiflash_probe,
+ .remove = spiflash_remove, + .remove = spiflash_remove,
+}; +};
+ +
+static int __init +module_platform_driver(spiflash_driver);
+spiflash_init(void)
+{
+ return platform_driver_register(&spiflash_driver);
+}
+
+static void __exit
+spiflash_exit(void)
+{
+ return platform_driver_unregister(&spiflash_driver);
+}
+
+module_init(spiflash_init);
+module_exit(spiflash_exit);
+ +
+MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL");
+MODULE_AUTHOR("OpenWrt.org, Atheros Communications Inc"); +MODULE_AUTHOR("OpenWrt.org");
+MODULE_DESCRIPTION("MTD driver for SPI Flash on Atheros SOC"); +MODULE_AUTHOR("Atheros Communications Inc");
+MODULE_DESCRIPTION("MTD driver for SPI Flash on Atheros AR2315+ SOC");
+MODULE_ALIAS("platform:" DRIVER_NAME);
+ +
--- /dev/null --- /dev/null
+++ b/drivers/mtd/devices/ar2315_spiflash.h +++ b/drivers/mtd/devices/ar2315_spiflash.h