From patchwork Tue Jan 6 21:32:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 16864 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 94CCF47689 for ; Wed, 7 Jan 2009 08:35:09 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from VA3EHSOBE003.bigfish.com (outbound-va3.frontbridge.com [216.32.180.16]) by ozlabs.org (Postfix) with ESMTP id 507B8474F5; Wed, 7 Jan 2009 08:33:16 +1100 (EST) Received: from mail87-va3-R.bigfish.com (10.7.14.249) by VA3EHSOBE003.bigfish.com (10.7.40.23) with Microsoft SMTP Server id 8.1.291.1; Tue, 6 Jan 2009 21:33:15 +0000 Received: from mail87-va3 (localhost.localdomain [127.0.0.1]) by mail87-va3-R.bigfish.com (Postfix) with ESMTP id 6A1A51B10232; Tue, 6 Jan 2009 21:33:15 +0000 (UTC) X-BigFish: VPS9(zcb8kz853k19c2kzzzzz2fh6bh65h) X-Spam-TCS-SCL: 4:0 X-FB-SS: 5, Received: by mail87-va3 (MessageSwitch) id 1231277593507898_25477; Tue, 6 Jan 2009 21:33:13 +0000 (UCT) Received: from mail8.fw-bc.sony.com (mail8.fw-bc.sony.com [160.33.98.75]) by mail87-va3.bigfish.com (Postfix) with ESMTP id 6F1203E005D; Tue, 6 Jan 2009 21:33:13 +0000 (UTC) Received: from mail3.sjc.in.sel.sony.com (mail3.sjc.in.sel.sony.com [43.134.1.211]) by mail8.fw-bc.sony.com (8.14.2/8.14.2) with ESMTP id n06LXC48007409; Tue, 6 Jan 2009 21:33:13 GMT Received: from ussdixhub21.spe.sony.com (ussdixhub21.spe.sony.com [43.130.141.76]) by mail3.sjc.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id n06LX9T2019376; Tue, 6 Jan 2009 21:33:12 GMT Received: from USSDIXRG02.am.sony.com (43.130.140.32) by ussdixhub21.spe.sony.com (43.130.141.76) with Microsoft SMTP Server id 8.1.291.1; Tue, 6 Jan 2009 13:32:51 -0800 Received: from ussdixms03.am.sony.com ([43.130.140.23]) by USSDIXRG02.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 6 Jan 2009 13:32:51 -0800 Received: from [192.168.1.10] ([43.135.148.226]) by ussdixms03.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 6 Jan 2009 13:32:51 -0800 Message-ID: <4963CDEC.2000003@am.sony.com> Date: Tue, 6 Jan 2009 13:32:28 -0800 From: Geoff Levand User-Agent: Thunderbird 2.0.0.18 (X11/20081119) MIME-Version: 1.0 To: Benjamin Herrenschmidt Subject: [patch 5/6] mtd/ps3vram: Use kernel types References: <4963CA52.9030902@am.sony.com> In-Reply-To: <4963CA52.9030902@am.sony.com> X-Enigmail-Version: 0.95.7 X-OriginalArrivalTime: 06 Jan 2009 21:32:51.0475 (UTC) FILETIME=[53EBBE30:01C97046] X-SEL-encryption-scan: scanned Cc: David Woodhouse , Arnd Bergmann , Jim Paris , linuxppc-dev@ozlabs.org, Vivien Chappelier , cbe-oss-dev@ozlabs.org X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Replace the use of stdint.h types with kernel types in the ps3vram driver. Signed-off-by: Geoff Levand --- drivers/mtd/devices/ps3vram.c | 56 ++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 26 deletions(-) --- a/drivers/mtd/devices/ps3vram.c +++ b/drivers/mtd/devices/ps3vram.c @@ -65,15 +65,15 @@ struct ps3vram_cache { }; struct ps3vram_priv { - uint64_t memory_handle; - uint64_t context_handle; - uint8_t *base; - uint32_t *ctrl; - uint32_t *reports; - uint8_t *xdr_buf; + u64 memory_handle; + u64 context_handle; + u32 *ctrl; + u32 *reports; + u8 *base; + u8 *xdr_buf; - uint32_t *fifo_base; - uint32_t *fifo_ptr; + u32 *fifo_base; + u32 *fifo_ptr; struct device *dev; struct ps3vram_cache cache; @@ -92,7 +92,7 @@ char *size = "256M-"; module_param(size, charp, 0); MODULE_PARM_DESC(size, "memory size"); -static inline uint32_t *ps3vram_get_notifier(uint32_t *reports, int notifier) +static u32 *ps3vram_get_notifier(u32 *reports, int notifier) { return (void *) reports + DMA_NOTIFIER_OFFSET_BASE + @@ -102,8 +102,9 @@ static inline uint32_t *ps3vram_get_noti static void ps3vram_notifier_reset(struct mtd_info *mtd) { int i; + struct ps3vram_priv *priv = mtd->priv; - uint32_t *notify = ps3vram_get_notifier(priv->reports, NOTIFIER); + u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER); for (i = 0; i < 4; i++) notify[i] = 0xffffffff; } @@ -111,7 +112,7 @@ static void ps3vram_notifier_reset(struc static int ps3vram_notifier_wait(struct mtd_info *mtd, int timeout_ms) { struct ps3vram_priv *priv = mtd->priv; - uint32_t *notify = ps3vram_get_notifier(priv->reports, NOTIFIER); + u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER); timeout_ms *= 1000; @@ -155,13 +156,13 @@ static int ps3vram_wait_ring(struct mtd_ return 0; } -static inline void ps3vram_out_ring(struct ps3vram_priv *priv, uint32_t data) +static void ps3vram_out_ring(struct ps3vram_priv *priv, u32 data) { *(priv->fifo_ptr)++ = data; } -static inline void ps3vram_begin_ring(struct ps3vram_priv *priv, uint32_t chan, - uint32_t tag, uint32_t size) +static void ps3vram_begin_ring(struct ps3vram_priv *priv, u32 chan, + u32 tag, u32 size) { ps3vram_out_ring(priv, (size << 18) | (chan << 13) | tag); } @@ -194,7 +195,7 @@ static void ps3vram_fire_ring(struct mtd mutex_lock(&ps3_gpu_mutex); priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET + - (priv->fifo_ptr - priv->fifo_base) * sizeof(uint32_t); + (priv->fifo_ptr - priv->fifo_base) * sizeof(u32); /* asking the HV for a blit will kick the fifo */ status = lv1_gpu_context_attribute(priv->context_handle, @@ -204,8 +205,8 @@ static void ps3vram_fire_ring(struct mtd dev_err(priv->dev, "%s:%d: lv1_gpu_context_attribute failed\n", __func__, __LINE__); - if ((priv->fifo_ptr - priv->fifo_base) * sizeof(uint32_t) > - FIFO_SIZE - 1024) { + if ((priv->fifo_ptr - priv->fifo_base) * sizeof(u32) > + FIFO_SIZE - 1024) { dev_dbg(priv->dev, "%s:%d: fifo full, rewinding\n", __func__, __LINE__); ps3vram_wait_ring(mtd, 200); @@ -538,10 +539,13 @@ static int ps3vram_write(struct mtd_info static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev) { struct ps3vram_priv *priv; - uint64_t status; - uint64_t ddr_lpar, ctrl_lpar, info_lpar, reports_lpar; - int64_t ddr_size; - uint64_t reports_size; + int status; + u64 ddr_lpar; + u64 ctrl_lpar; + u64 info_lpar; + u64 reports_lpar; + u64 ddr_size; + u64 reports_size; int ret = -ENOMEM; char *rest; @@ -555,8 +559,8 @@ static int __devinit ps3vram_probe(struc priv->dev = &dev->core; /* Allocate XDR buffer (1MiB aligned) */ - priv->xdr_buf = (uint8_t *) __get_free_pages(GFP_KERNEL, - get_order(XDR_BUF_SIZE)); + priv->xdr_buf = (void *)__get_free_pages(GFP_KERNEL, + get_order(XDR_BUF_SIZE)); if (priv->xdr_buf == NULL) { dev_dbg(&dev->core, "%s:%d: could not allocate XDR buffer\n", __func__, __LINE__); @@ -565,7 +569,7 @@ static int __devinit ps3vram_probe(struc } /* Put FIFO at begginning of XDR buffer */ - priv->fifo_base = (uint32_t *) (priv->xdr_buf + FIFO_OFFSET); + priv->fifo_base = (u32 *) (priv->xdr_buf + FIFO_OFFSET); priv->fifo_ptr = priv->fifo_base; /* XXX: Need to open GPU, in case ps3fb or snd_ps3 aren't loaded */ @@ -593,11 +597,11 @@ static int __devinit ps3vram_probe(struc status = lv1_gpu_memory_allocate(ddr_size, 0, 0, 0, 0, &priv->memory_handle, &ddr_lpar); - if (status == 0) + if (!status) break; ddr_size -= 1024*1024; } - if (status != 0 || ddr_size <= 0) { + if (status || ddr_size <= 0) { dev_err(&dev->core, "%s:%d: lv1_gpu_memory_allocate failed\n", __func__, __LINE__); ret = -ENOMEM;