[PATCH 002/524] spectra: Make it build as a module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: David Woodhouse <David.Woodhouse@xxxxxxxxx>

... by killing the gratuitous 'res_nand' early_param() and turning it
into a module_param() called 'reserved_mb' instead.

Signed-off-by: David Woodhouse <David.Woodhouse@xxxxxxxxx>
---
 drivers/block/spectra/ffsport.c |   26 ++++----------------------
 1 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/drivers/block/spectra/ffsport.c b/drivers/block/spectra/ffsport.c
index 0b3d49d..c53face 100644
--- a/drivers/block/spectra/ffsport.c
+++ b/drivers/block/spectra/ffsport.c
@@ -126,7 +126,9 @@ u64 GLOB_u64_Remainder(u64 addr, u32 divisor_type)
 #define GLOB_SBD_IOCTL_WRITE_DATA                (0x7709)
 #define GLOB_SBD_IOCTL_READ_DATA                 (0x770A)
 
-static u32 reserved_mb_for_os_image = 0;
+static int reserved_mb = 0;
+module_param(reserved_mb, int, 0);
+MODULE_PARM_DESC(reserved_mb, "Reserved space for OS image, in MiB (default 25 MiB)");
 
 int nand_debug_level;
 module_param(nand_debug_level, int, 0644);
@@ -262,7 +264,7 @@ static int get_res_blk_num_os(void)
 	blk_size = IdentifyDeviceData.PageDataSize *
 		IdentifyDeviceData.PagesPerBlock;
 
-	res_blks = (reserved_mb_for_os_image * 1024 * 1024) / blk_size;
+	res_blks = (reserved_mb * 1024 * 1024) / blk_size;
 
 	if ((res_blks < 1) || (res_blks >= IdentifyDeviceData.wDataBlockNum))
 		res_blks = 1; /* Reserved 1 block for block table */
@@ -823,25 +825,5 @@ static void __exit GLOB_SBD_exit(void)
 		       GLOB_SBD_majornum);
 }
 
-static int __init setup_reserve_space_for_os_image(char *cmdline)
-{
-	unsigned long value;
-	int error;
-
-	printk(KERN_ALERT "Spectra - cmdline: %s\n", cmdline);
-	if (!cmdline)
-		return -EINVAL;
-
-	error = strict_strtoul((const char *)cmdline, 10, &value);
-	if (error)
-		return -EINVAL;
-
-	reserved_mb_for_os_image = value;
-
-	return 0;
-}
-
-early_param("res_nand", setup_reserve_space_for_os_image);
-
 module_init(GLOB_SBD_init);
 module_exit(GLOB_SBD_exit);
-- 
1.7.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux