diff options
| author | Faik Uygur <faikuygur@ttnet.net.tr> | 2003-02-23 18:49:22 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-02-23 18:49:22 -0800 |
| commit | b096c3f53d303daec0d88dade64377e373d8d104 (patch) | |
| tree | ff87554e14d0e8967177a2f013cb43f2c631181d | |
| parent | e7070c0f0ec1df10d687eb1f3e480e6c37de27d9 (diff) | |
[PATCH] /proc/ide/triflex returns incomplete data
This patch fixes the incomplete data return problem of /proc/ide/triflex.
When the number of consecutive read bytes are smaller than the total
data in triflex_get_info(), the second read() returns 0.
| -rw-r--r-- | drivers/ide/pci/triflex.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index c969bb9027ef..b71af07f3755 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c @@ -49,6 +49,7 @@ static struct pci_dev *triflex_dev; static int triflex_get_info(char *buf, char **addr, off_t offset, int count) { char *p = buf; + int len; struct pci_dev *dev = triflex_dev; unsigned long bibma = pci_resource_start(dev, 4); @@ -85,8 +86,11 @@ static int triflex_get_info(char *buf, char **addr, off_t offset, int count) p += sprintf(p, "DMA\n"); p += sprintf(p, "PIO\n"); + + len = (p - buf) - offset; + *addr = buf + offset; - return p-buf; + return len > count ? count : len; } static int triflex_tune_chipset(ide_drive_t *drive, u8 xferspeed) |
