diff options
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/core-cdev.c | 24 | ||||
-rw-r--r-- | drivers/firewire/ohci.c | 9 |
2 files changed, 28 insertions, 5 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index e6ad3bb6c1a6..4799393247c8 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c | |||
@@ -216,15 +216,33 @@ struct inbound_phy_packet_event { | |||
216 | struct fw_cdev_event_phy_packet phy_packet; | 216 | struct fw_cdev_event_phy_packet phy_packet; |
217 | }; | 217 | }; |
218 | 218 | ||
219 | static inline void __user *u64_to_uptr(__u64 value) | 219 | #ifdef CONFIG_COMPAT |
220 | static void __user *u64_to_uptr(u64 value) | ||
221 | { | ||
222 | if (is_compat_task()) | ||
223 | return compat_ptr(value); | ||
224 | else | ||
225 | return (void __user *)(unsigned long)value; | ||
226 | } | ||
227 | |||
228 | static u64 uptr_to_u64(void __user *ptr) | ||
229 | { | ||
230 | if (is_compat_task()) | ||
231 | return ptr_to_compat(ptr); | ||
232 | else | ||
233 | return (u64)(unsigned long)ptr; | ||
234 | } | ||
235 | #else | ||
236 | static inline void __user *u64_to_uptr(u64 value) | ||
220 | { | 237 | { |
221 | return (void __user *)(unsigned long)value; | 238 | return (void __user *)(unsigned long)value; |
222 | } | 239 | } |
223 | 240 | ||
224 | static inline __u64 uptr_to_u64(void __user *ptr) | 241 | static inline u64 uptr_to_u64(void __user *ptr) |
225 | { | 242 | { |
226 | return (__u64)(unsigned long)ptr; | 243 | return (u64)(unsigned long)ptr; |
227 | } | 244 | } |
245 | #endif /* CONFIG_COMPAT */ | ||
228 | 246 | ||
229 | static int fw_device_op_open(struct inode *inode, struct file *file) | 247 | static int fw_device_op_open(struct inode *inode, struct file *file) |
230 | { | 248 | { |
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index bcf792fac442..57cd3a406edf 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -2179,8 +2179,13 @@ static int ohci_enable(struct fw_card *card, | |||
2179 | ohci_driver_name, ohci)) { | 2179 | ohci_driver_name, ohci)) { |
2180 | fw_error("Failed to allocate interrupt %d.\n", dev->irq); | 2180 | fw_error("Failed to allocate interrupt %d.\n", dev->irq); |
2181 | pci_disable_msi(dev); | 2181 | pci_disable_msi(dev); |
2182 | dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, | 2182 | |
2183 | ohci->config_rom, ohci->config_rom_bus); | 2183 | if (config_rom) { |
2184 | dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, | ||
2185 | ohci->next_config_rom, | ||
2186 | ohci->next_config_rom_bus); | ||
2187 | ohci->next_config_rom = NULL; | ||
2188 | } | ||
2184 | return -EIO; | 2189 | return -EIO; |
2185 | } | 2190 | } |
2186 | 2191 | ||