diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-01-09 14:18:33 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-09 14:18:33 -0500 |
commit | 0a3a98f6dd4e8f4d928a09302c0d1c56f2192ac3 (patch) | |
tree | 92f55e374a84d06ce8213a4540454760fdecf137 /drivers/mtd | |
parent | 8ef12c9f01afba47c2d33bb939085111ca0d0f7d (diff) | |
parent | 5367f2d67c7d0bf1faae90e6e7b4e2ac3c9b5e0f (diff) |
Merge Linus' tree.
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 25 | ||||
-rw-r--r-- | drivers/mtd/onenand/generic.c | 1 | ||||
-rw-r--r-- | drivers/mtd/rfd_ftl.c | 1 |
3 files changed, 11 insertions, 16 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 339cb1218eaa..7f3ff500b68e 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -194,6 +194,14 @@ static int blktrans_release(struct inode *i, struct file *f) | |||
194 | return ret; | 194 | return ret; |
195 | } | 195 | } |
196 | 196 | ||
197 | static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo) | ||
198 | { | ||
199 | struct mtd_blktrans_dev *dev = bdev->bd_disk->private_data; | ||
200 | |||
201 | if (dev->tr->getgeo) | ||
202 | return dev->tr->getgeo(dev, geo); | ||
203 | return -ENOTTY; | ||
204 | } | ||
197 | 205 | ||
198 | static int blktrans_ioctl(struct inode *inode, struct file *file, | 206 | static int blktrans_ioctl(struct inode *inode, struct file *file, |
199 | unsigned int cmd, unsigned long arg) | 207 | unsigned int cmd, unsigned long arg) |
@@ -207,22 +215,6 @@ static int blktrans_ioctl(struct inode *inode, struct file *file, | |||
207 | return tr->flush(dev); | 215 | return tr->flush(dev); |
208 | /* The core code did the work, we had nothing to do. */ | 216 | /* The core code did the work, we had nothing to do. */ |
209 | return 0; | 217 | return 0; |
210 | |||
211 | case HDIO_GETGEO: | ||
212 | if (tr->getgeo) { | ||
213 | struct hd_geometry g; | ||
214 | int ret; | ||
215 | |||
216 | memset(&g, 0, sizeof(g)); | ||
217 | ret = tr->getgeo(dev, &g); | ||
218 | if (ret) | ||
219 | return ret; | ||
220 | |||
221 | g.start = get_start_sect(inode->i_bdev); | ||
222 | if (copy_to_user((void __user *)arg, &g, sizeof(g))) | ||
223 | return -EFAULT; | ||
224 | return 0; | ||
225 | } /* else */ | ||
226 | default: | 218 | default: |
227 | return -ENOTTY; | 219 | return -ENOTTY; |
228 | } | 220 | } |
@@ -233,6 +225,7 @@ struct block_device_operations mtd_blktrans_ops = { | |||
233 | .open = blktrans_open, | 225 | .open = blktrans_open, |
234 | .release = blktrans_release, | 226 | .release = blktrans_release, |
235 | .ioctl = blktrans_ioctl, | 227 | .ioctl = blktrans_ioctl, |
228 | .getgeo = blktrans_getgeo, | ||
236 | }; | 229 | }; |
237 | 230 | ||
238 | int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new) | 231 | int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new) |
diff --git a/drivers/mtd/onenand/generic.c b/drivers/mtd/onenand/generic.c index 45c077d0f063..af06a80f44de 100644 --- a/drivers/mtd/onenand/generic.c +++ b/drivers/mtd/onenand/generic.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/slab.h> | ||
17 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
18 | #include <linux/mtd/mtd.h> | 19 | #include <linux/mtd/mtd.h> |
19 | #include <linux/mtd/onenand.h> | 20 | #include <linux/mtd/onenand.h> |
diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index 20ce212638fc..a3e00a4635a5 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/drivers/mtd/rfd_ftl.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/mtd/blktrans.h> | 18 | #include <linux/mtd/blktrans.h> |
19 | #include <linux/mtd/mtd.h> | 19 | #include <linux/mtd/mtd.h> |
20 | #include <linux/vmalloc.h> | 20 | #include <linux/vmalloc.h> |
21 | #include <linux/slab.h> | ||
21 | #include <linux/jiffies.h> | 22 | #include <linux/jiffies.h> |
22 | 23 | ||
23 | #include <asm/types.h> | 24 | #include <asm/types.h> |