diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2019-01-16 13:25:23 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-22 07:40:00 -0500 |
commit | 8fdf90626588bc02af1200f6320d1d9c0540526f (patch) | |
tree | 9a94d16bdfea10dc75aa673e7e12dda5a5a98010 /drivers/ntb | |
parent | 0795ccde5c7632a692713ef0d8490171c1eb3ffb (diff) |
ntb: ntb_hw_switchtec: Cleanup 64bit IO defines to use the common header
Clean up the ifdefs which conditionally defined the io{read|write}64
functions in favour of the new common io-64-nonatomic-lo-hi header.
Per a nit from Andy Shevchenko, the include list is also made
alphabetical.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/ntb')
-rw-r--r-- | drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c index 5ee5f40b4dfc..c0b97699169d 100644 --- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c +++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c | |||
@@ -13,13 +13,14 @@ | |||
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/switchtec.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/module.h> | 17 | #include <linux/io-64-nonatomic-lo-hi.h> |
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/kthread.h> | 19 | #include <linux/kthread.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/module.h> |
21 | #include <linux/ntb.h> | 21 | #include <linux/ntb.h> |
22 | #include <linux/pci.h> | 22 | #include <linux/pci.h> |
23 | #include <linux/switchtec.h> | ||
23 | 24 | ||
24 | MODULE_DESCRIPTION("Microsemi Switchtec(tm) NTB Driver"); | 25 | MODULE_DESCRIPTION("Microsemi Switchtec(tm) NTB Driver"); |
25 | MODULE_VERSION("0.1"); | 26 | MODULE_VERSION("0.1"); |
@@ -36,35 +37,6 @@ module_param(use_lut_mws, bool, 0644); | |||
36 | MODULE_PARM_DESC(use_lut_mws, | 37 | MODULE_PARM_DESC(use_lut_mws, |
37 | "Enable the use of the LUT based memory windows"); | 38 | "Enable the use of the LUT based memory windows"); |
38 | 39 | ||
39 | #ifndef ioread64 | ||
40 | #ifdef readq | ||
41 | #define ioread64 readq | ||
42 | #else | ||
43 | #define ioread64 _ioread64 | ||
44 | static inline u64 _ioread64(void __iomem *mmio) | ||
45 | { | ||
46 | u64 low, high; | ||
47 | |||
48 | low = ioread32(mmio); | ||
49 | high = ioread32(mmio + sizeof(u32)); | ||
50 | return low | (high << 32); | ||
51 | } | ||
52 | #endif | ||
53 | #endif | ||
54 | |||
55 | #ifndef iowrite64 | ||
56 | #ifdef writeq | ||
57 | #define iowrite64 writeq | ||
58 | #else | ||
59 | #define iowrite64 _iowrite64 | ||
60 | static inline void _iowrite64(u64 val, void __iomem *mmio) | ||
61 | { | ||
62 | iowrite32(val, mmio); | ||
63 | iowrite32(val >> 32, mmio + sizeof(u32)); | ||
64 | } | ||
65 | #endif | ||
66 | #endif | ||
67 | |||
68 | #define SWITCHTEC_NTB_MAGIC 0x45CC0001 | 40 | #define SWITCHTEC_NTB_MAGIC 0x45CC0001 |
69 | #define MAX_MWS 128 | 41 | #define MAX_MWS 128 |
70 | 42 | ||