diff options
author | Emil Goode <emil.fsw@goode.io> | 2018-05-16 06:22:04 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2018-05-18 05:23:48 -0400 |
commit | 2f8a6da866eff746a9f8c7745790f3765baeb589 (patch) | |
tree | b7e5eeec4e1e8b019fe9b7c39ff363c622b7256f | |
parent | 5cb8b9969be6f14ac3b7ba90de8f7a65f68e46fe (diff) |
gpu: host1x: Fix compiler errors by converting to dma_addr_t
The compiler is complaining with the following errors:
drivers/gpu/host1x/cdma.c:94:48: error:
passing argument 3 of ‘dma_alloc_wc’ from incompatible pointer type
[-Werror=incompatible-pointer-types]
drivers/gpu/host1x/cdma.c:113:48: error:
passing argument 3 of ‘dma_alloc_wc’ from incompatible pointer type
[-Werror=incompatible-pointer-types]
The expected pointer type of the third argument to dma_alloc_wc() is
dma_addr_t but phys_addr_t is passed.
Change the phys member of struct push_buffer to be dma_addr_t so that we
pass the correct type to dma_alloc_wc().
Also check pb->mapped for non-NULL in the destroy function as that is the
right way of checking if dma_alloc_wc() was successful.
Signed-off-by: Emil Goode <emil.fsw@goode.io>
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/gpu/host1x/cdma.c | 2 | ||||
-rw-r--r-- | drivers/gpu/host1x/cdma.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c index cf6caa90bf89..69bb77372ed9 100644 --- a/drivers/gpu/host1x/cdma.c +++ b/drivers/gpu/host1x/cdma.c | |||
@@ -51,7 +51,7 @@ static void host1x_pushbuffer_destroy(struct push_buffer *pb) | |||
51 | struct host1x_cdma *cdma = pb_to_cdma(pb); | 51 | struct host1x_cdma *cdma = pb_to_cdma(pb); |
52 | struct host1x *host1x = cdma_to_host1x(cdma); | 52 | struct host1x *host1x = cdma_to_host1x(cdma); |
53 | 53 | ||
54 | if (!pb->phys) | 54 | if (!pb->mapped) |
55 | return; | 55 | return; |
56 | 56 | ||
57 | if (host1x->domain) { | 57 | if (host1x->domain) { |
diff --git a/drivers/gpu/host1x/cdma.h b/drivers/gpu/host1x/cdma.h index 286d49386be9..446ee1a84969 100644 --- a/drivers/gpu/host1x/cdma.h +++ b/drivers/gpu/host1x/cdma.h | |||
@@ -44,7 +44,7 @@ struct host1x_job; | |||
44 | struct push_buffer { | 44 | struct push_buffer { |
45 | void *mapped; /* mapped pushbuffer memory */ | 45 | void *mapped; /* mapped pushbuffer memory */ |
46 | dma_addr_t dma; /* device address of pushbuffer */ | 46 | dma_addr_t dma; /* device address of pushbuffer */ |
47 | phys_addr_t phys; /* physical address of pushbuffer */ | 47 | dma_addr_t phys; /* physical address of pushbuffer */ |
48 | u32 fence; /* index we've written */ | 48 | u32 fence; /* index we've written */ |
49 | u32 pos; /* index to write to */ | 49 | u32 pos; /* index to write to */ |
50 | u32 size; | 50 | u32 size; |