Skip to content

Commit 16adce7

Browse files
committed
[MTD] [ONENAND] Make onenand_sim compile on non-ARM platforms.
The whole point of a sim is that it should run almost anywhere. Gratuitously depending on '#define SZ_128K 131072' from an ARM-specific header isn't really a good idea. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
1 parent c9856e3 commit 16adce7

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎drivers/mtd/onenand/onenand_sim.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The OneNAND simulator
55
*
6-
* Copyright(C) 2005-2007 Samsung Electronics
6+
* Copyright © 2005-2007 Samsung Electronics
77
* Kyungmin Park <kyungmin.park@samsung.com>
88
*
99
* This program is free software; you can redistribute it and/or modify
@@ -19,8 +19,7 @@
1919
#include <linux/mtd/partitions.h>
2020
#include <linux/mtd/onenand.h>
2121

22-
#include <asm/io.h>
23-
#include <asm/sizes.h>
22+
#include <linux/io.h>
2423

2524
#ifndef CONFIG_ONENAND_SIM_MANUFACTURER
2625
#define CONFIG_ONENAND_SIM_MANUFACTURER 0xec
@@ -83,7 +82,8 @@ struct onenand_info *info;
8382

8483
#define DPRINTK(format, args...) \
8584
do { \
86-
printk("%s[%d]: " format "\n", __func__, __LINE__, ##args); \
85+
printk(KERN_DEBUG "%s[%d]: " format "\n", __func__, \
86+
__LINE__, ##args); \
8787
} while (0)
8888

8989
/**
@@ -382,9 +382,9 @@ static int __init flash_init(struct onenand_flash *flash)
382382
int density, size;
383383
int buffer_size;
384384

385-
flash->base = kzalloc(SZ_128K, GFP_KERNEL);
385+
flash->base = kzalloc(131072, GFP_KERNEL);
386386
if (!flash->base) {
387-
printk(KERN_ERR "Unalbe to allocate base address.\n");
387+
printk(KERN_ERR "Unable to allocate base address.\n");
388388
return -ENOMEM;
389389
}
390390

@@ -393,7 +393,7 @@ static int __init flash_init(struct onenand_flash *flash)
393393

394394
ONENAND_CORE(flash) = vmalloc(size + (size >> 5));
395395
if (!ONENAND_CORE(flash)) {
396-
printk(KERN_ERR "Unalbe to allocate nand core address.\n");
396+
printk(KERN_ERR "Unable to allocate nand core address.\n");
397397
kfree(flash->base);
398398
return -ENOMEM;
399399
}
@@ -406,9 +406,9 @@ static int __init flash_init(struct onenand_flash *flash)
406406
writew(version_id, flash->base + ONENAND_REG_VERSION_ID);
407407

408408
if (density < 2)
409-
buffer_size = 0x0400; /* 1KB page */
409+
buffer_size = 0x0400; /* 1KiB page */
410410
else
411-
buffer_size = 0x0800; /* 2KB page */
411+
buffer_size = 0x0800; /* 2KiB page */
412412
writew(buffer_size, flash->base + ONENAND_REG_DATA_BUFFER_SIZE);
413413

414414
return 0;

0 commit comments

Comments
 (0)