Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Signed-off-by: unsik Kim <donari75@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by

unsik Kim and committed by
Jens Axboe
5ced504b e475bba2

+46 -27
+1 -27
drivers/block/mg_disk.c
··· 22 22 #include <linux/delay.h> 23 23 #include <linux/platform_device.h> 24 24 #include <linux/gpio.h> 25 + #include <linux/mg_disk.h> 25 26 26 27 #define MG_RES_SEC (CONFIG_MG_DISK_RES << 1) 27 28 28 29 /* name for block device */ 29 30 #define MG_DISK_NAME "mgd" 30 - /* name for platform device */ 31 - #define MG_DEV_NAME "mg_disk" 32 31 33 32 #define MG_DISK_MAJ 0 34 33 #define MG_DISK_MAX_PART 16 ··· 102 103 #define MG_TMAX_SWRST_TO_RDY 500 103 104 #define MG_TMAX_RSTOUT 3000 104 105 105 - /* device attribution */ 106 - /* use mflash as boot device */ 107 - #define MG_BOOT_DEV (1 << 0) 108 - /* use mflash as storage device */ 109 - #define MG_STORAGE_DEV (1 << 1) 110 - /* same as MG_STORAGE_DEV, but bootloader already done reset sequence */ 111 - #define MG_STORAGE_DEV_SKIP_RST (1 << 2) 112 - 113 106 #define MG_DEV_MASK (MG_BOOT_DEV | MG_STORAGE_DEV | MG_STORAGE_DEV_SKIP_RST) 114 - 115 - /* names of GPIO resource */ 116 - #define MG_RST_PIN "mg_rst" 117 - /* except MG_BOOT_DEV, reset-out pin should be assigned */ 118 - #define MG_RSTOUT_PIN "mg_rstout" 119 - 120 - /* private driver data */ 121 - struct mg_drv_data { 122 - /* disk resource */ 123 - u32 use_polling; 124 - 125 - /* device attribution */ 126 - u32 dev_attr; 127 - 128 - /* internally used */ 129 - struct mg_host *host; 130 - }; 131 107 132 108 /* main structure for mflash driver */ 133 109 struct mg_host {
+45
include/linux/mg_disk.h
··· 1 + /* 2 + * include/linux/mg_disk.c 3 + * 4 + * Private data for mflash platform driver 5 + * 6 + * (c) 2008 mGine Co.,LTD 7 + * (c) 2008 unsik Kim <donari75@gmail.com> 8 + * 9 + * This program is free software; you can redistribute it and/or modify 10 + * it under the terms of the GNU General Public License version 2 as 11 + * published by the Free Software Foundation. 12 + */ 13 + 14 + #ifndef __MG_DISK_H__ 15 + #define __MG_DISK_H__ 16 + 17 + /* name for platform device */ 18 + #define MG_DEV_NAME "mg_disk" 19 + 20 + /* names of GPIO resource */ 21 + #define MG_RST_PIN "mg_rst" 22 + /* except MG_BOOT_DEV, reset-out pin should be assigned */ 23 + #define MG_RSTOUT_PIN "mg_rstout" 24 + 25 + /* device attribution */ 26 + /* use mflash as boot device */ 27 + #define MG_BOOT_DEV (1 << 0) 28 + /* use mflash as storage device */ 29 + #define MG_STORAGE_DEV (1 << 1) 30 + /* same as MG_STORAGE_DEV, but bootloader already done reset sequence */ 31 + #define MG_STORAGE_DEV_SKIP_RST (1 << 2) 32 + 33 + /* private driver data */ 34 + struct mg_drv_data { 35 + /* disk resource */ 36 + u32 use_polling; 37 + 38 + /* device attribution */ 39 + u32 dev_attr; 40 + 41 + /* internally used */ 42 + void *host; 43 + }; 44 + 45 + #endif