1 From 993e62e674ba670341f11f60398446bb37a88e8b Mon Sep 17 00:00:00 2001
2 From: Geoff Levand <geoffrey.levand@am.sony.com>
3 Date: Tue, 6 Jan 2009 11:32:28 +0000
4 Subject: [PATCH] mtd/ps3vram: Use proper kernel types
6 Replace the use of stdint.h types with kernel types
9 Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
10 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
12 drivers/mtd/devices/ps3vram.c | 56 ++++++++++++++++++++++-------------------
13 1 files changed, 30 insertions(+), 26 deletions(-)
15 diff --git a/drivers/mtd/devices/ps3vram.c b/drivers/mtd/devices/ps3vram.c
16 index f5cc290..91cc2af 100644
17 --- a/drivers/mtd/devices/ps3vram.c
18 +++ b/drivers/mtd/devices/ps3vram.c
19 @@ -65,15 +65,15 @@ struct ps3vram_cache {
23 - uint64_t memory_handle;
24 - uint64_t context_handle;
36 - uint32_t *fifo_base;
42 struct ps3vram_cache cache;
43 @@ -92,7 +92,7 @@ char *size = "256M-";
44 module_param(size, charp, 0);
45 MODULE_PARM_DESC(size, "memory size");
47 -static inline uint32_t *ps3vram_get_notifier(uint32_t *reports, int notifier)
48 +static u32 *ps3vram_get_notifier(u32 *reports, int notifier)
50 return (void *) reports +
51 DMA_NOTIFIER_OFFSET_BASE +
52 @@ -102,8 +102,9 @@ static inline uint32_t *ps3vram_get_notifier(uint32_t *reports, int notifier)
53 static void ps3vram_notifier_reset(struct mtd_info *mtd)
57 struct ps3vram_priv *priv = mtd->priv;
58 - uint32_t *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
59 + u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
60 for (i = 0; i < 4; i++)
61 notify[i] = 0xffffffff;
63 @@ -111,7 +112,7 @@ static void ps3vram_notifier_reset(struct mtd_info *mtd)
64 static int ps3vram_notifier_wait(struct mtd_info *mtd, int timeout_ms)
66 struct ps3vram_priv *priv = mtd->priv;
67 - uint32_t *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
68 + u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
72 @@ -155,13 +156,13 @@ static int ps3vram_wait_ring(struct mtd_info *mtd, int timeout)
76 -static inline void ps3vram_out_ring(struct ps3vram_priv *priv, uint32_t data)
77 +static void ps3vram_out_ring(struct ps3vram_priv *priv, u32 data)
79 *(priv->fifo_ptr)++ = data;
82 -static inline void ps3vram_begin_ring(struct ps3vram_priv *priv, uint32_t chan,
83 - uint32_t tag, uint32_t size)
84 +static void ps3vram_begin_ring(struct ps3vram_priv *priv, u32 chan,
87 ps3vram_out_ring(priv, (size << 18) | (chan << 13) | tag);
89 @@ -194,7 +195,7 @@ static void ps3vram_fire_ring(struct mtd_info *mtd)
90 mutex_lock(&ps3_gpu_mutex);
92 priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET +
93 - (priv->fifo_ptr - priv->fifo_base) * sizeof(uint32_t);
94 + (priv->fifo_ptr - priv->fifo_base) * sizeof(u32);
96 /* asking the HV for a blit will kick the fifo */
97 status = lv1_gpu_context_attribute(priv->context_handle,
98 @@ -204,8 +205,8 @@ static void ps3vram_fire_ring(struct mtd_info *mtd)
99 dev_err(priv->dev, "%s:%d: lv1_gpu_context_attribute failed\n",
102 - if ((priv->fifo_ptr - priv->fifo_base) * sizeof(uint32_t) >
103 - FIFO_SIZE - 1024) {
104 + if ((priv->fifo_ptr - priv->fifo_base) * sizeof(u32) >
105 + FIFO_SIZE - 1024) {
106 dev_dbg(priv->dev, "%s:%d: fifo full, rewinding\n", __func__,
108 ps3vram_wait_ring(mtd, 200);
109 @@ -538,10 +539,13 @@ static int ps3vram_write(struct mtd_info *mtd, loff_t to, size_t len,
110 static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
112 struct ps3vram_priv *priv;
114 - uint64_t ddr_lpar, ctrl_lpar, info_lpar, reports_lpar;
116 - uint64_t reports_size;
127 @@ -555,8 +559,8 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
128 priv->dev = &dev->core;
130 /* Allocate XDR buffer (1MiB aligned) */
131 - priv->xdr_buf = (uint8_t *) __get_free_pages(GFP_KERNEL,
132 - get_order(XDR_BUF_SIZE));
133 + priv->xdr_buf = (void *)__get_free_pages(GFP_KERNEL,
134 + get_order(XDR_BUF_SIZE));
135 if (priv->xdr_buf == NULL) {
136 dev_dbg(&dev->core, "%s:%d: could not allocate XDR buffer\n",
138 @@ -565,7 +569,7 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
141 /* Put FIFO at begginning of XDR buffer */
142 - priv->fifo_base = (uint32_t *) (priv->xdr_buf + FIFO_OFFSET);
143 + priv->fifo_base = (u32 *) (priv->xdr_buf + FIFO_OFFSET);
144 priv->fifo_ptr = priv->fifo_base;
146 /* XXX: Need to open GPU, in case ps3fb or snd_ps3 aren't loaded */
147 @@ -593,11 +597,11 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
148 status = lv1_gpu_memory_allocate(ddr_size, 0, 0, 0, 0,
149 &priv->memory_handle,
154 ddr_size -= 1024*1024;
156 - if (status != 0 || ddr_size <= 0) {
157 + if (status || ddr_size <= 0) {
158 dev_err(&dev->core, "%s:%d: lv1_gpu_memory_allocate failed\n",