diff options
author | Ryosuke Saito <raitosyo@gmail.com> | 2012-04-23 06:47:17 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-05-13 23:56:52 -0400 |
commit | 39a5d0b93c244f40ee2e1502e4870685b7dcc1fa (patch) | |
tree | 2d53feef3ca84b4bdd2bb30f8fbf0fcfac583ab0 /drivers/mtd | |
parent | 5329d67cc32c0306426dc4bc4b5e66a36cb87ce0 (diff) |
mtd: block2mtd: page_read() never returns NULL
page_read() never returns NULL, so we can remove the NULL check here.
Signed-off-by: Ryosuke Saito <raitosyo@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/devices/block2mtd.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index a4a80b742e65..300aeb837ee3 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c | |||
@@ -52,8 +52,6 @@ static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t to, size_t len) | |||
52 | 52 | ||
53 | while (pages) { | 53 | while (pages) { |
54 | page = page_read(mapping, index); | 54 | page = page_read(mapping, index); |
55 | if (!page) | ||
56 | return -ENOMEM; | ||
57 | if (IS_ERR(page)) | 55 | if (IS_ERR(page)) |
58 | return PTR_ERR(page); | 56 | return PTR_ERR(page); |
59 | 57 | ||
@@ -112,8 +110,6 @@ static int block2mtd_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
112 | len = len - cpylen; | 110 | len = len - cpylen; |
113 | 111 | ||
114 | page = page_read(dev->blkdev->bd_inode->i_mapping, index); | 112 | page = page_read(dev->blkdev->bd_inode->i_mapping, index); |
115 | if (!page) | ||
116 | return -ENOMEM; | ||
117 | if (IS_ERR(page)) | 113 | if (IS_ERR(page)) |
118 | return PTR_ERR(page); | 114 | return PTR_ERR(page); |
119 | 115 | ||
@@ -148,8 +144,6 @@ static int _block2mtd_write(struct block2mtd_dev *dev, const u_char *buf, | |||
148 | len = len - cpylen; | 144 | len = len - cpylen; |
149 | 145 | ||
150 | page = page_read(mapping, index); | 146 | page = page_read(mapping, index); |
151 | if (!page) | ||
152 | return -ENOMEM; | ||
153 | if (IS_ERR(page)) | 147 | if (IS_ERR(page)) |
154 | return PTR_ERR(page); | 148 | return PTR_ERR(page); |
155 | 149 | ||