diff options
author | Joao Ramos <joao.ramos@inov.pt> | 2009-06-15 16:13:44 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-06-15 16:13:44 -0400 |
commit | 5bfb151f1f565e6082304a30e8c81dfb6ed0b0c8 (patch) | |
tree | 331727c29645788035c4f4b0e617f8f0c9c52e1d /drivers/ide/qd65xx.h | |
parent | 3779f818a42879038c4be8bc83123432b774279d (diff) |
ide: do not access ide_drive_t 'drive_data' field directly
Change ide_drive_t 'drive_data' field from 'unsigned int' type to 'void *'
type, allowing a wider range of values/types to be stored in this field.
Added 'ide_get_drivedata' and 'ide_set_drivedata' helpers to get and set
the 'drive_data' field.
Fixed all host drivers to maintain coherency with the change in the
'drive_data' field type.
Signed-off-by: Joao Ramos <joao.ramos@inov.pt>
[bart: fix qd65xx build, cast to 'unsigned long', minor Coding Style fixups]
Acked-by: Sergei Shtylyov <sshtylyov@ru.montavista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/qd65xx.h')
-rw-r--r-- | drivers/ide/qd65xx.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/ide/qd65xx.h b/drivers/ide/qd65xx.h index d7e67a1a1dcc..1fba2a5f281c 100644 --- a/drivers/ide/qd65xx.h +++ b/drivers/ide/qd65xx.h | |||
@@ -31,8 +31,15 @@ | |||
31 | 31 | ||
32 | #define QD_CONFIG(hwif) ((hwif)->config_data & 0x00ff) | 32 | #define QD_CONFIG(hwif) ((hwif)->config_data & 0x00ff) |
33 | 33 | ||
34 | #define QD_TIMING(drive) (u8)(((drive)->drive_data) & 0x00ff) | 34 | static inline u8 QD_TIMING(ide_drive_t *drive) |
35 | #define QD_TIMREG(drive) (u8)((((drive)->drive_data) & 0xff00) >> 8) | 35 | { |
36 | return (unsigned long)ide_get_drivedata(drive) & 0x00ff; | ||
37 | } | ||
38 | |||
39 | static inline u8 QD_TIMREG(ide_drive_t *drive) | ||
40 | { | ||
41 | return ((unsigned long)ide_get_drivedata(drive) & 0xff00) >> 8; | ||
42 | } | ||
36 | 43 | ||
37 | #define QD6500_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0c : 0x08)) | 44 | #define QD6500_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0c : 0x08)) |
38 | #define QD6580_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0a : 0x00)) | 45 | #define QD6580_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0a : 0x00)) |