Commit eadcf0d7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

MTD: handle pci_name() being const

This changes the MTD core to handle pci_name() now returning a constant
string.

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 89bcb05d
...@@ -241,6 +241,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size) ...@@ -241,6 +241,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
{ {
struct block_device *bdev; struct block_device *bdev;
struct block2mtd_dev *dev; struct block2mtd_dev *dev;
char *name;
if (!devname) if (!devname)
return NULL; return NULL;
...@@ -279,12 +280,13 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size) ...@@ -279,12 +280,13 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
/* Setup the MTD structure */ /* Setup the MTD structure */
/* make the name contain the block device in */ /* make the name contain the block device in */
dev->mtd.name = kmalloc(sizeof("block2mtd: ") + strlen(devname), name = kmalloc(sizeof("block2mtd: ") + strlen(devname) + 1,
GFP_KERNEL); GFP_KERNEL);
if (!dev->mtd.name) if (!name)
goto devinit_err; goto devinit_err;
sprintf(dev->mtd.name, "block2mtd: %s", devname); sprintf(name, "block2mtd: %s", devname);
dev->mtd.name = name;
dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK; dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
dev->mtd.erasesize = erase_size; dev->mtd.erasesize = erase_size;
......
...@@ -189,7 +189,7 @@ typedef union { ...@@ -189,7 +189,7 @@ typedef union {
*/ */
struct map_info { struct map_info {
char *name; const char *name;
unsigned long size; unsigned long size;
resource_size_t phys; resource_size_t phys;
#define NO_XIP (-1UL) #define NO_XIP (-1UL)
......
...@@ -121,7 +121,7 @@ struct mtd_info { ...@@ -121,7 +121,7 @@ struct mtd_info {
u_int32_t oobavail; // Available OOB bytes per block u_int32_t oobavail; // Available OOB bytes per block
// Kernel-only stuff starts here. // Kernel-only stuff starts here.
char *name; const char *name;
int index; int index;
/* ecc layout structure pointer - read only ! */ /* ecc layout structure pointer - read only ! */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment