aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/cchips/voyagergx/consistent.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/cchips/voyagergx/consistent.c')
-rw-r--r--arch/sh/cchips/voyagergx/consistent.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/sh/cchips/voyagergx/consistent.c b/arch/sh/cchips/voyagergx/consistent.c
index 3d9a02c093a3..07e8b9c5a531 100644
--- a/arch/sh/cchips/voyagergx/consistent.c
+++ b/arch/sh/cchips/voyagergx/consistent.c
@@ -15,7 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/bus-sh.h> 18
19 19
20struct voya_alloc_entry { 20struct voya_alloc_entry {
21 struct list_head list; 21 struct list_head list;
@@ -30,12 +30,13 @@ static LIST_HEAD(voya_alloc_list);
30#define OHCI_HCCA_SIZE 0x100 30#define OHCI_HCCA_SIZE 0x100
31#define OHCI_SRAM_SIZE 0x10000 31#define OHCI_SRAM_SIZE 0x10000
32 32
33#define VOYAGER_OHCI_NAME "voyager-ohci"
34
33void *voyagergx_consistent_alloc(struct device *dev, size_t size, 35void *voyagergx_consistent_alloc(struct device *dev, size_t size,
34 dma_addr_t *handle, gfp_t flag) 36 dma_addr_t *handle, gfp_t flag)
35{ 37{
36 struct list_head *list = &voya_alloc_list; 38 struct list_head *list = &voya_alloc_list;
37 struct voya_alloc_entry *entry; 39 struct voya_alloc_entry *entry;
38 struct sh_dev *shdev = to_sh_dev(dev);
39 unsigned long start, end; 40 unsigned long start, end;
40 unsigned long flags; 41 unsigned long flags;
41 42
@@ -46,9 +47,7 @@ void *voyagergx_consistent_alloc(struct device *dev, size_t size,
46 * 47 *
47 * Everything else goes through consistent_alloc(). 48 * Everything else goes through consistent_alloc().
48 */ 49 */
49 if (!dev || dev->bus != &sh_bus_types[SH_BUS_VIRT] || 50 if (!dev || strcmp(dev->driver->name, VOYAGER_OHCI_NAME))
50 (dev->bus == &sh_bus_types[SH_BUS_VIRT] &&
51 shdev->dev_id != SH_DEV_ID_USB_OHCI))
52 return NULL; 51 return NULL;
53 52
54 start = OHCI_SRAM_START + OHCI_HCCA_SIZE; 53 start = OHCI_SRAM_START + OHCI_HCCA_SIZE;
@@ -98,12 +97,9 @@ int voyagergx_consistent_free(struct device *dev, size_t size,
98 void *vaddr, dma_addr_t handle) 97 void *vaddr, dma_addr_t handle)
99{ 98{
100 struct voya_alloc_entry *entry; 99 struct voya_alloc_entry *entry;
101 struct sh_dev *shdev = to_sh_dev(dev);
102 unsigned long flags; 100 unsigned long flags;
103 101
104 if (!dev || dev->bus != &sh_bus_types[SH_BUS_VIRT] || 102 if (!dev || strcmp(dev->driver->name, VOYAGER_OHCI_NAME))
105 (dev->bus == &sh_bus_types[SH_BUS_VIRT] &&
106 shdev->dev_id != SH_DEV_ID_USB_OHCI))
107 return -EINVAL; 103 return -EINVAL;
108 104
109 spin_lock_irqsave(&voya_list_lock, flags); 105 spin_lock_irqsave(&voya_list_lock, flags);
@@ -123,4 +119,3 @@ int voyagergx_consistent_free(struct device *dev, size_t size,
123 119
124EXPORT_SYMBOL(voyagergx_consistent_alloc); 120EXPORT_SYMBOL(voyagergx_consistent_alloc);
125EXPORT_SYMBOL(voyagergx_consistent_free); 121EXPORT_SYMBOL(voyagergx_consistent_free);
126