Commit graph android_kernel_sony_sdm845/include/linux
Message SHA1
mtd: do not use mtd->sync directly
This patch teaches 'mtd_sync()' to do nothing when the MTD driver does
not have the '->sync()' method, which allows us to remove all direct
'mtd->sync' accesses.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:21 +00:00
327cf2922b
mtd: harmonize mtd_writev usage
This patch makes the 'mtd_writev()' function more usable and logical. We first
teach it to fall-back to the 'default_mtd_writev()' function if the MTD driver
does not define its own '->writev()' method. Then we make block2mtd and JFFS2
just 'mtd_writev()' instead of 'default_mtd_writev()' function. This means we
can now stop exporting 'default_mtd_writev()' and instead, export
'mtd_writev()'. This is much cleaner and more logical, as well as allows us to
get read of another direct 'mtd->writev' access in JFFS2.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:19 +00:00
1dbebd3256
mtd: do not use mtd->lock_user_prot_reg directly
Instead, check the -EOPNOTSUPP return code of 'mtd_lock_user_prot_reg()'.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:18 +00:00
e2936b2af5
mtd: mtd->write_user_prot_reg directly
Instead, just call 'mtd_write_user_prot_reg()' and check the '-EOPNOTSUPP' return
code.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:17 +00:00
27c151a5e5
mtd: do not use mtd->read_*_prot_reg directly
Instead, call 'mtd_read_*_prot_info()' and check for -EOPNOTSUPP.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:16 +00:00
b6de3d6cb6
mtd: do not use mtd->get_*_prot_info directly
Instead, call 'mtd_get_*_prot_info()' and check for '-EOPNOTSUPP'. While
on it, fix the return code from '-EOPNOTSUPP' to '-EINVAL' for the case
when the mode parameter is invalid.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:15 +00:00
87e858a97e
mtd: do not use mtd->read_oob directly
Instead of checking whether 'mtd->read_oob' is defined, just call
'mtd_read_oob()' and handle the '-EOPNOTSUPP' error which will be returned
if the function is undefined.

Additionally, make 'mtd_write_oob()' return '-EOPNOTSUPP' if the function
is undefined.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:14 +00:00
dac2639f98
mtd: mtdoops: do not use mtd->panic_write directly
Instead of checking if 'mtd->panic_write' is defined, call 'mtd_panic_write()'
and check the error code - '-EOPNOTSUPP' will be returned if the function is
not defined.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:13 +00:00
016c1291ce
mtd: do not use mtd->get_unmapped_area directly
Remove direct usage of mtd->get_unmapped_area. Instead, just call
'mtd_get_unmapped_area()' which will return -EOPNOTSUPP if the function
is not implemented and test for this error code.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:10 +00:00
cd621274b0
mtd: do use mtd->point directly
Remove direct usage of the "mtd->point" function pointer. Instead,
test the mtd_point() return code for '-EOPNOTSUPP'.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:09 +00:00
10934478e4
mtd: introduce mtd_has_oob helper
We are working in the direction of making sure that MTD clients to not
use 'mtd->func' pointers directly. In some places we want to know if
OOB operations are supported by an MTD device. Introduce 'mtd_has_oob()'
helper for these purposes.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:08 +00:00
fc002e3c32
mtd: clean-up the default_mtd_writev function
1. Teach 'mtd_write()' function to return '-EROFS' if the write method
   is undefined, and remove the corresponding check from
   'default_mtd_writev()'.
2. Do not test 'retlen' for NULL - it cannot be NULL.
3. Few minor coding stile clean-ups.
4. Add a kerneldoc comment

Additionally, minor fixes to the kerneldoc comments of the neighbor function.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:05 +00:00
52b020317f
mtd: remove unused default_mtd_readv prototype
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:26:03 +00:00
bac9727774
mtd: kill dev_to_mtd helper
... since it is not needed because the generic 'dev_get_drvdata()' can be
used instead.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:57 +00:00
d5de20a9a1
mtd: always initialize retlen to zero
Make sure that the retlen is set to 0 in case of error. This harmonizes
drivers - some set it to 0 in some error cases and do not write anything
in other error cases. Now we can do this consistently for all drivers.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:54 +00:00
9cf075f865
mtd: move mtd->{get,put}_device functions up
Move the 'get_device()' and 'put_device()' functions up within
'struct mtd_info' to make them be close to other functions.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:50 +00:00
a88d2dc672
mtd: introduce mtd_block_markbad interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:48 +00:00
5942ddbc50
mtd: introduce mtd_block_isbad interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:47 +00:00
7086c19d07
mtd: introduce mtd_resume interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:46 +00:00
ead995f8d4
mtd: introduce mtd_suspend interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:45 +00:00
3fe4bae884
mtd: introduce mtd_is_locked interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:42 +00:00
e95e978645
mtd: introduce mtd_unlock interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:40 +00:00
b66005cd3e
mtd: introduce mtd_lock interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:39 +00:00
7799f9ac8d
mtd: introduce mtd_sync interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:35 +00:00
85f2f2a809
mtd: introduce mtd_writev interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:34 +00:00
b0a31f7b2a
mtd: introduce mtd_lock_user_prot_reg interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:33 +00:00
4403dbfb45
mtd: introduce mtd_write_user_prot_reg interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:31 +00:00
482b43adbb
mtd: introduce mtd_read_user_prot_reg interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:30 +00:00
4ea1cabb92
mtd: introduce mtd_get_user_prot_info interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:29 +00:00
855e5d8cfe
mtd: introduce mtd_read_fact_prot_reg interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:27 +00:00
d264f72ae5
mtd: introduce mtd_get_fact_prot_info interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:25 +00:00
a750b5ce5e
mtd: introduce mtd_write_oob interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:24 +00:00
a2cc5ba075
mtd: introduce mtd_read_oob interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:23 +00:00
fd2819bbc9
mtd: introduce mtd_panic_write interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:22 +00:00
7ae79d7ff1
mtd: introduce mtd_write interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:20 +00:00
eda95cbf75
mtd: introduce mtd_read interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:19 +00:00
329ad399a9
mtd: introduce mtd_get_unmapped_area interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:18 +00:00
04c601bfa4
mtd: introduce mtd_unpoint interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:17 +00:00
7219778ad9
mtd: introduce mtd_point interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:15 +00:00
d35ea200c0
mtd: introduce mtd_erase interface
This patch is part of a patch-set which changes the MTD interface
from 'mtd->func()' form to 'mtd_func()' form. We need this because
we want to add common code to to all drivers in the mtd core level,
which is impossible with the current interface when MTD clients
call driver functions like 'read()' or 'write()' directly.

At this point we just introduce a new inline wrapper function, but
later some of them are expected to gain more code. E.g., the input
parameters check should be moved to the wrappers rather than be
duplicated at many drivers.

This particular patch introduced the 'mtd_erase()' interface. The
following patches add all the other interfaces one by one.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:25:11 +00:00
7e1f0dc055
mtd: map.h: fix arm cross-build failure
This patch fixes the following build failure:
In file included from include/linux/mtd/qinfo.h:4:0,
                 from include/linux/mtd/pfow.h:7,
                 from drivers/mtd/lpddr/lpddr_cmds.c:27:
include/linux/mtd/map.h: In function 'inline_map_read':
include/linux/mtd/map.h:409:3: error: implicit declaration of function 'BUILD_BUG_ON' [-Werror=implicit-function-declaration]

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Artem Bityutskiy   authored and   David Woodhouse   commited 2012-01-09 18:24:34 +00:00
4a42243886
mtd: maps: physmap: allow partition parsers for physmap_flash_data
Arch setup code might want to use their own partition parsers, but still
use the generic physmap flash driver.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Jonas Gorski   authored and   David Woodhouse   commited 2012-01-09 18:16:15 +00:00
529688fed6
mtd: cfi: Allow per-mapping CFI device endianness
This patch allows each CFI device map to use its own endianness. The
globally defined CFI endianness (CONFIG_MTD_CFI_NOSWAP,
CONFIG_MTD_CFI_BE_BYTE_SWAP or CONFIG_MTD_CFI_LE_BYTE_SWAP) becomes the
default value which can be overridden by a driver for a particular device.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Aaron Sierra   authored and   David Woodhouse   commited 2012-01-09 18:06:13 +00:00
8e987465a1
mtd: nand: add Macronix manufacturer
Macronix is produing SLC NAND MX30LF1208AA, so add their manufacturer
code to the manufacturer lists.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Brian Norris   authored and   David Woodhouse   commited 2012-01-09 17:59:33 +00:00
c1257b4798
Merge branch 'samsung/driver' into next/drivers
Conflicts:
	arch/arm/mach-mxs/include/mach/common.h

Pull in previous samsung conflict merges and do a trivial
merge of an mxs double-add conflict.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Arnd Bergmann   commited 2012-01-09 16:16:29 +00:00
dcf7ec5ee6
jbd: Remove j_barrier mutex
j_barrier mutex is used for serializing different journal lock operations.  The
problem with it is that e.g. FIFREEZE ioctl results in process leaving kernel
with j_barrier mutex held which makes lockdep freak out. Also hibernation code
wants to freeze filesystem but it cannot do so because it then cannot hibernate
the system because of mutex being locked.

So we remove j_barrier mutex and use direct wait on j_barrier_count instead.
Since locking journal is a rare operation we don't have to care about fairness
or such things.

CC: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Jan Kara <jack@suse.cz>

Jan Kara   commited 2012-01-09 13:52:09 +01:00
0048278552
Merge branches 'iommu/page-sizes' and 'iommu/group-id' into next
Conflicts:
	drivers/iommu/amd_iommu.c
	drivers/iommu/intel-iommu.c
	include/linux/iommu.h

Joerg Roedel   commited 2012-01-09 13:06:28 +01:00
f93ea73387
Merge branches 'iommu/fixes', 'arm/omap' and 'x86/amd' into next
Conflicts:
	drivers/pci/hotplug/acpiphp_glue.c

Joerg Roedel   commited 2012-01-09 13:04:05 +01:00
00fb5430f5
Merge branch 'hid-battery' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen into for-linus
Jiri Kosina   commited 2012-01-09 11:24:59 +01:00
420174afdc
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into sh-latest
Conflicts:
	arch/arm/mach-shmobile/clock-sh73a0.c

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

Paul Mundt   commited 2012-01-09 11:12:55 +09:00
ca371d2854