aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-15 13:01:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-15 13:01:16 -0400
commit0cb583fd2862f19ea88b02eb307d11c09e51e2f8 (patch)
tree740769ab145ed72af4d00ea8e4d55ebcef337fce
parent723e9db7a46e328527cc3da2b478b831184fe828 (diff)
parenta2d10568fd3965fffeb29a3a6f29966dd3801727 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6: ide: fixup for fujitsu disk ide: convert to ->proc_fops at91_ide: remove headers specific for at91sam9263 IDE: palm_bk3710: convert clock usage after clkdev conversion ide: fix races in handling of user-space SET XFER commands ide: allow ide_dev_read_id() to be called from the IRQ context ide: ide-taskfile.c fix style problems drivers/ide/ide-cd.c: Use DIV_ROUND_CLOSEST ide-tape: fix handling of postponed rqs ide-tape: convert to ide_debug_log macro ide-tape: fix debug call ide: Fix annoying warning in ide_pio_bytes(). IDE: Save a call to PageHighMem()
-rw-r--r--drivers/ide/at91_ide.c2
-rw-r--r--drivers/ide/ide-cd.c32
-rw-r--r--drivers/ide/ide-disk_proc.c129
-rw-r--r--drivers/ide/ide-floppy_proc.c30
-rw-r--r--drivers/ide/ide-ioctls.c8
-rw-r--r--drivers/ide/ide-iops.c17
-rw-r--r--drivers/ide/ide-probe.c31
-rw-r--r--drivers/ide/ide-proc.c340
-rw-r--r--drivers/ide/ide-tape.c160
-rw-r--r--drivers/ide/ide-taskfile.c126
-rw-r--r--drivers/ide/palm_bk3710.c2
-rw-r--r--include/linux/ide.h30
12 files changed, 522 insertions, 385 deletions
diff --git a/drivers/ide/at91_ide.c b/drivers/ide/at91_ide.c
index dbfeda42b940..248219a89a68 100644
--- a/drivers/ide/at91_ide.c
+++ b/drivers/ide/at91_ide.c
@@ -29,9 +29,7 @@
29 29
30#include <mach/board.h> 30#include <mach/board.h>
31#include <mach/gpio.h> 31#include <mach/gpio.h>
32#include <mach/at91sam9263.h>
33#include <mach/at91sam9_smc.h> 32#include <mach/at91sam9_smc.h>
34#include <mach/at91sam9263_matrix.h>
35 33
36#define DRV_NAME "at91_ide" 34#define DRV_NAME "at91_ide"
37 35
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 6a9a769bffc1..b79ca419d8d9 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -30,6 +30,7 @@
30#include <linux/kernel.h> 30#include <linux/kernel.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/timer.h> 32#include <linux/timer.h>
33#include <linux/seq_file.h>
33#include <linux/slab.h> 34#include <linux/slab.h>
34#include <linux/interrupt.h> 35#include <linux/interrupt.h>
35#include <linux/errno.h> 36#include <linux/errno.h>
@@ -1146,8 +1147,8 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf)
1146 ide_debug_log(IDE_DBG_PROBE, "curspeed: %u, maxspeed: %u", 1147 ide_debug_log(IDE_DBG_PROBE, "curspeed: %u, maxspeed: %u",
1147 curspeed, maxspeed); 1148 curspeed, maxspeed);
1148 1149
1149 cd->current_speed = (curspeed + (176/2)) / 176; 1150 cd->current_speed = DIV_ROUND_CLOSEST(curspeed, 176);
1150 cd->max_speed = (maxspeed + (176/2)) / 176; 1151 cd->max_speed = DIV_ROUND_CLOSEST(maxspeed, 176);
1151} 1152}
1152 1153
1153#define IDE_CD_CAPABILITIES \ 1154#define IDE_CD_CAPABILITIES \
@@ -1389,19 +1390,30 @@ static sector_t ide_cdrom_capacity(ide_drive_t *drive)
1389 return capacity * sectors_per_frame; 1390 return capacity * sectors_per_frame;
1390} 1391}
1391 1392
1392static int proc_idecd_read_capacity(char *page, char **start, off_t off, 1393static int idecd_capacity_proc_show(struct seq_file *m, void *v)
1393 int count, int *eof, void *data)
1394{ 1394{
1395 ide_drive_t *drive = data; 1395 ide_drive_t *drive = m->private;
1396 int len;
1397 1396
1398 len = sprintf(page, "%llu\n", (long long)ide_cdrom_capacity(drive)); 1397 seq_printf(m, "%llu\n", (long long)ide_cdrom_capacity(drive));
1399 PROC_IDE_READ_RETURN(page, start, off, count, eof, len); 1398 return 0;
1399}
1400
1401static int idecd_capacity_proc_open(struct inode *inode, struct file *file)
1402{
1403 return single_open(file, idecd_capacity_proc_show, PDE(inode)->data);
1400} 1404}
1401 1405
1406static const struct file_operations idecd_capacity_proc_fops = {
1407 .owner = THIS_MODULE,
1408 .open = idecd_capacity_proc_open,
1409 .read = seq_read,
1410 .llseek = seq_lseek,
1411 .release = single_release,
1412};
1413
1402static ide_proc_entry_t idecd_proc[] = { 1414static ide_proc_entry_t idecd_proc[] = {
1403 { "capacity", S_IFREG|S_IRUGO, proc_idecd_read_capacity, NULL }, 1415 { "capacity", S_IFREG|S_IRUGO, &idecd_capacity_proc_fops },
1404 { NULL, 0, NULL, NULL } 1416 {}
1405}; 1417};
1406 1418
1407static ide_proc_entry_t *ide_cd_proc_entries(ide_drive_t *drive) 1419static ide_proc_entry_t *ide_cd_proc_entries(ide_drive_t *drive)
diff --git a/drivers/ide/ide-disk_proc.c b/drivers/ide/ide-disk_proc.c
index 19f263bf0a9e..60b0590ccc9c 100644
--- a/drivers/ide/ide-disk_proc.c
+++ b/drivers/ide/ide-disk_proc.c
@@ -1,5 +1,6 @@
1#include <linux/kernel.h> 1#include <linux/kernel.h>
2#include <linux/ide.h> 2#include <linux/ide.h>
3#include <linux/seq_file.h>
3 4
4#include "ide-disk.h" 5#include "ide-disk.h"
5 6
@@ -37,77 +38,117 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
37 return ide_raw_taskfile(drive, &cmd, buf, 1); 38 return ide_raw_taskfile(drive, &cmd, buf, 1);
38} 39}
39 40
40static int proc_idedisk_read_cache 41static int idedisk_cache_proc_show(struct seq_file *m, void *v)
41 (char *page, char **start, off_t off, int count, int *eof, void *data)
42{ 42{
43 ide_drive_t *drive = (ide_drive_t *) data; 43 ide_drive_t *drive = (ide_drive_t *) m->private;
44 char *out = page;
45 int len;
46 44
47 if (drive->dev_flags & IDE_DFLAG_ID_READ) 45 if (drive->dev_flags & IDE_DFLAG_ID_READ)
48 len = sprintf(out, "%i\n", drive->id[ATA_ID_BUF_SIZE] / 2); 46 seq_printf(m, "%i\n", drive->id[ATA_ID_BUF_SIZE] / 2);
49 else 47 else
50 len = sprintf(out, "(none)\n"); 48 seq_printf(m, "(none)\n");
49 return 0;
50}
51 51
52 PROC_IDE_READ_RETURN(page, start, off, count, eof, len); 52static int idedisk_cache_proc_open(struct inode *inode, struct file *file)
53{
54 return single_open(file, idedisk_cache_proc_show, PDE(inode)->data);
53} 55}
54 56
55static int proc_idedisk_read_capacity 57static const struct file_operations idedisk_cache_proc_fops = {
56 (char *page, char **start, off_t off, int count, int *eof, void *data) 58 .owner = THIS_MODULE,
59 .open = idedisk_cache_proc_open,
60 .read = seq_read,
61 .llseek = seq_lseek,
62 .release = single_release,
63};
64
65static int idedisk_capacity_proc_show(struct seq_file *m, void *v)
57{ 66{
58 ide_drive_t*drive = (ide_drive_t *)data; 67 ide_drive_t*drive = (ide_drive_t *)m->private;
59 int len;
60 68
61 len = sprintf(page, "%llu\n", (long long)ide_gd_capacity(drive)); 69 seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
70 return 0;
71}
62 72
63 PROC_IDE_READ_RETURN(page, start, off, count, eof, len); 73static int idedisk_capacity_proc_open(struct inode *inode, struct file *file)
74{
75 return single_open(file, idedisk_capacity_proc_show, PDE(inode)->data);
64} 76}
65 77
66static int proc_idedisk_read_smart(char *page, char **start, off_t off, 78static const struct file_operations idedisk_capacity_proc_fops = {
67 int count, int *eof, void *data, u8 sub_cmd) 79 .owner = THIS_MODULE,
80 .open = idedisk_capacity_proc_open,
81 .read = seq_read,
82 .llseek = seq_lseek,
83 .release = single_release,
84};
85
86static int __idedisk_proc_show(struct seq_file *m, ide_drive_t *drive, u8 sub_cmd)
68{ 87{
69 ide_drive_t *drive = (ide_drive_t *)data; 88 u8 *buf;
70 int len = 0, i = 0; 89
90 buf = kmalloc(SECTOR_SIZE, GFP_KERNEL);
91 if (!buf)
92 return -ENOMEM;
71 93
72 (void)smart_enable(drive); 94 (void)smart_enable(drive);
73 95
74 if (get_smart_data(drive, page, sub_cmd) == 0) { 96 if (get_smart_data(drive, buf, sub_cmd) == 0) {
75 unsigned short *val = (unsigned short *) page; 97 __le16 *val = (__le16 *)buf;
76