Merge tag 'for-linus-3.3' of git://git.infradead.org/mtd-2.6
MTD pull for 3.3 * tag 'for-linus-3.3' of git://git.infradead.org/mtd-2.6: (113 commits) mtd: Fix dependency for MTD_DOC200x mtd: do not use mtd->block_markbad directly logfs: do not use 'mtd->block_isbad' directly mtd: introduce mtd_can_have_bb helper mtd: do not use mtd->suspend and mtd->resume directly mtd: do not use mtd->lock, unlock and is_locked directly mtd: do not use mtd->sync directly mtd: harmonize mtd_writev usage mtd: do not use mtd->lock_user_prot_reg directly mtd: mtd->write_user_prot_reg directly mtd: do not use mtd->read_*_prot_reg directly mtd: do not use mtd->get_*_prot_info directly mtd: do not use mtd->read_oob directly mtd: mtdoops: do not use mtd->panic_write directly romfs: do not use mtd->get_unmapped_area directly mtd: do not use mtd->get_unmapped_area directly mtd: do use mtd->point directly mtd: introduce mtd_has_oob helper mtd: mtdcore: export symbols cleanup mtd: clean-up the default_mtd_writev function ... Fix up trivial edit/remove conflict in drivers/staging/spectra/lld_mtd.c
This commit is contained in:
@@ -28,9 +28,10 @@ static unsigned long romfs_get_unmapped_area(struct file *file,
|
||||
struct inode *inode = file->f_mapping->host;
|
||||
struct mtd_info *mtd = inode->i_sb->s_mtd;
|
||||
unsigned long isize, offset, maxpages, lpages;
|
||||
int ret;
|
||||
|
||||
if (!mtd)
|
||||
goto cant_map_directly;
|
||||
return (unsigned long) -ENOSYS;
|
||||
|
||||
/* the mapping mustn't extend beyond the EOF */
|
||||
lpages = (len + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
||||
@@ -41,23 +42,20 @@ static unsigned long romfs_get_unmapped_area(struct file *file,
|
||||
if ((pgoff >= maxpages) || (maxpages - pgoff < lpages))
|
||||
return (unsigned long) -EINVAL;
|
||||
|
||||
/* we need to call down to the MTD layer to do the actual mapping */
|
||||
if (mtd->get_unmapped_area) {
|
||||
if (addr != 0)
|
||||
return (unsigned long) -EINVAL;
|
||||
if (addr != 0)
|
||||
return (unsigned long) -EINVAL;
|
||||
|
||||
if (len > mtd->size || pgoff >= (mtd->size >> PAGE_SHIFT))
|
||||
return (unsigned long) -EINVAL;
|
||||
if (len > mtd->size || pgoff >= (mtd->size >> PAGE_SHIFT))
|
||||
return (unsigned long) -EINVAL;
|
||||
|
||||
offset += ROMFS_I(inode)->i_dataoffset;
|
||||
if (offset > mtd->size - len)
|
||||
return (unsigned long) -EINVAL;
|
||||
offset += ROMFS_I(inode)->i_dataoffset;
|
||||
if (offset > mtd->size - len)
|
||||
return (unsigned long) -EINVAL;
|
||||
|
||||
return mtd->get_unmapped_area(mtd, len, offset, flags);
|
||||
}
|
||||
|
||||
cant_map_directly:
|
||||
return (unsigned long) -ENOSYS;
|
||||
ret = mtd_get_unmapped_area(mtd, len, offset, flags);
|
||||
if (ret == -EOPNOTSUPP)
|
||||
ret = -ENOSYS;
|
||||
return (unsigned long) ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user