diff options
Diffstat (limited to 'drivers/ata/pata_cs5536.c')
-rw-r--r-- | drivers/ata/pata_cs5536.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c index 21ee23f89e88..628c8fae5937 100644 --- a/drivers/ata/pata_cs5536.c +++ b/drivers/ata/pata_cs5536.c | |||
@@ -37,10 +37,22 @@ | |||
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/libata.h> | 38 | #include <linux/libata.h> |
39 | #include <scsi/scsi_host.h> | 39 | #include <scsi/scsi_host.h> |
40 | |||
41 | #ifdef CONFIG_X86_32 | ||
40 | #include <asm/msr.h> | 42 | #include <asm/msr.h> |
43 | static int use_msr; | ||
44 | module_param_named(msr, use_msr, int, 0644); | ||
45 | MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)"); | ||
46 | #else | ||
47 | #undef rdmsr /* avoid accidental MSR usage on, e.g. x86-64 */ | ||
48 | #undef wrmsr | ||
49 | #define rdmsr(x, y, z) do { } while (0) | ||
50 | #define wrmsr(x, y, z) do { } while (0) | ||
51 | #define use_msr 0 | ||
52 | #endif | ||
41 | 53 | ||
42 | #define DRV_NAME "pata_cs5536" | 54 | #define DRV_NAME "pata_cs5536" |
43 | #define DRV_VERSION "0.0.7" | 55 | #define DRV_VERSION "0.0.8" |
44 | 56 | ||
45 | enum { | 57 | enum { |
46 | CFG = 0, | 58 | CFG = 0, |
@@ -75,8 +87,6 @@ enum { | |||
75 | IDE_ETC_NODMA = 0x03, | 87 | IDE_ETC_NODMA = 0x03, |
76 | }; | 88 | }; |
77 | 89 | ||
78 | static int use_msr; | ||
79 | |||
80 | static const u32 msr_reg[4] = { | 90 | static const u32 msr_reg[4] = { |
81 | MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC, | 91 | MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC, |
82 | }; | 92 | }; |
@@ -88,7 +98,7 @@ static const u8 pci_reg[4] = { | |||
88 | static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) | 98 | static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) |
89 | { | 99 | { |
90 | if (unlikely(use_msr)) { | 100 | if (unlikely(use_msr)) { |
91 | u32 dummy; | 101 | u32 dummy __maybe_unused; |
92 | 102 | ||
93 | rdmsr(msr_reg[reg], *val, dummy); | 103 | rdmsr(msr_reg[reg], *val, dummy); |
94 | return 0; | 104 | return 0; |
@@ -294,8 +304,6 @@ MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller"); | |||
294 | MODULE_LICENSE("GPL"); | 304 | MODULE_LICENSE("GPL"); |
295 | MODULE_DEVICE_TABLE(pci, cs5536); | 305 | MODULE_DEVICE_TABLE(pci, cs5536); |
296 | MODULE_VERSION(DRV_VERSION); | 306 | MODULE_VERSION(DRV_VERSION); |
297 | module_param_named(msr, use_msr, int, 0644); | ||
298 | MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)"); | ||
299 | 307 | ||
300 | module_init(cs5536_init); | 308 | module_init(cs5536_init); |
301 | module_exit(cs5536_exit); | 309 | module_exit(cs5536_exit); |