]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: harmonize mtd_point interface implementation
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 8 Feb 2012 13:13:26 +0000 (15:13 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:32:11 +0000 (00:32 +0100)
commit1cf8b7aba8a13aa0ff5af7aac89d0645b684a648
treec828429698c28367a5f5804ce1c3f0972af83ff4
parent8e696df054e73766595aa3d5f2a25f67e240706e
mtd: harmonize mtd_point interface implementation

Some MTD drivers return -EINVAL if the 'phys' parameter is not NULL, trying to
convey that they cannot return the physical address. However, this is not very
logical because they still can return the virtual address ('virt'). But some
drivers (lpddr) just ignore the 'phys' parameter instead, which is a more
logical thing to do.

Let's harmonize this and:

1. Always initialize 'virt' and 'phys' to 'NULL' in 'mtd_point()'.
2. Do not return an error if the physical address cannot be found.

So as a result, all drivers will set 'phys' to 'NULL' if it is not supported.
None of the 'mtd_point()' users use 'phys' anyway, so this should not break
anything. I guess we could also just delete this parameter later.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/mtdram.c
drivers/mtd/devices/phram.c
drivers/mtd/devices/pmc551.c
drivers/mtd/devices/slram.c
drivers/mtd/mtdcore.c