Skip to contentSkip to conversation

mg_disk: seperate mg_disk.h again

PATCH Applied unsik Kim 3 participants 3 messages Jun 16, 2009 Block layer

lore
Share & tools
lore

unsik Kim

author
#0 lore raw

PATCH 1/1 mg_disk: seperate mg_disk.h again

eec9462088a26c046d4db3100796a340a50890b8 fold mg_disk.h into mg_disk.c, but mg_disk platform driver needs private data for operation. This also make mg_disk.c as machine independent. Seperate only needed structure and defines to mg_disk.h

---
Sorry for the very very late reply for message <[email protected]>.

---
 drivers/block/mg_disk.c |   28 +---------------------------
 include/linux/mg_disk.h |   45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 27 deletions(-)
 create mode 100644 include/linux/mg_disk.h
drivers/block/mg_disk.c +1 -27
index 60de5a0..f703f54 100644
@@ -22,13 +22,12 @@
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/mg_disk.h>
 
 #define MG_RES_SEC (CONFIG_MG_DISK_RES << 1)
 
 /* name for block device */
 #define MG_DISK_NAME "mgd"
-/* name for platform device */
-#define MG_DEV_NAME "mg_disk"
 
 #define MG_DISK_MAJ 0
 #define MG_DISK_MAX_PART 16
@@ -103,33 +102,8 @@
 #define MG_TMAX_SWRST_TO_RDY	500
 #define MG_TMAX_RSTOUT		3000
 
-/* device attribution */
-/* use mflash as boot device */
-#define MG_BOOT_DEV		(1 << 0)
-/* use mflash as storage device */
-#define MG_STORAGE_DEV		(1 << 1)
-/* same as MG_STORAGE_DEV, but bootloader already done reset sequence */
-#define MG_STORAGE_DEV_SKIP_RST	(1 << 2)
-
 #define MG_DEV_MASK (MG_BOOT_DEV | MG_STORAGE_DEV | MG_STORAGE_DEV_SKIP_RST)
 
-/* names of GPIO resource */
-#define MG_RST_PIN	"mg_rst"
-/* except MG_BOOT_DEV, reset-out pin should be assigned */
-#define MG_RSTOUT_PIN	"mg_rstout"
-
-/* private driver data */
-struct mg_drv_data {
-	/* disk resource */
-	u32 use_polling;
-
-	/* device attribution */
-	u32 dev_attr;
-
-	/* internally used */
-	struct mg_host *host;
-};
-
 /* main structure for mflash driver */
 struct mg_host {
 	struct device *dev;
include/linux/mg_disk.h new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
1.6.0.6
Applied
#1 lore raw
Quoted 4 lines · unsik Kim

eec9462088a26c046d4db3100796a340a50890b8 fold mg_disk.h into mg_disk.c, but mg_disk platform driver needs private data for operation. This also make mg_disk.c as machine independent. Seperate only needed structure and defines to mg_disk.h

Applied

Signature · 1 line
Jens Axboe
#2 lore raw
In reply to unsik Kim
Quoted 6 lines · unsik Kim

eec9462088a26c046d4db3100796a340a50890b8 fold mg_disk.h into mg_disk.c, but mg_disk platform driver needs private data for operation. This also make mg_disk.c as machine independent. Seperate only needed structure and defines to mg_disk.h

...

include/linux/mg_disk.h line 2

Quoted 8 lines
include/linux/mg_disk.h new file +2 -0
new file mode 100644
index 0000000..e11f4d9
@@ -0,0 +1,45 @@
+/*
+ *  include/linux/mg_disk.c
                           ^^^ oops

include/linux/mg_disk.h line 7

Quoted 5 lines
include/linux/mg_disk.h new file +5 -0
+ *
+ *  Private data for mflash platform driver
+ *
+ * (c) 2008 mGine Co.,LTD
+ * (c) 2008 unsik Kim <[email protected]>

Thanks.

Signature · 1 line
tejun