Received: from mail.onstor.com (66.201.51.107) by exch1.onstor.net
 (10.0.0.225) with Microsoft SMTP Server id 8.1.311.2; Thu, 23 Apr 2009
 18:42:25 -0700
Received: from psmtp.com ([64.18.0.98]) by mail.onstor.com with Microsoft
 SMTPSVC(6.0.3790.3959);	 Thu, 23 Apr 2009 18:42:22 -0700
Received: from source ([213.58.128.207]) by exprod5mx275.postini.com
 ([64.18.4.11]) with SMTP;	Thu, 23 Apr 2009 17:42:22 PST
Received: from localhost.localdomain ([127.0.0.1]:47491 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP	id S20021973AbZDXBmR
 (ORCPT <rfc822;andy.sharp@onstor.com>);	Fri, 24 Apr 2009 02:42:17 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 24 Apr 2009 02:42:00
 +0100 (BST)
Received: from [65.98.92.6] ([65.98.92.6]:18952 "EHLO b32.net")	by
 ftp.linux-mips.org with ESMTP id S20021959AbZDXBlv (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 24 Apr 2009 02:41:51 +0100
Received: (qmail 22971 invoked from network); 24 Apr 2009 01:41:48 -0000
Received: from softdnserror (HELO two) (127.0.0.1)  by softdnserror with SMTP;
 24 Apr 2009 01:41:48 -0000
Received: by two (sSMTP sendmail emulation); Thu, 23 Apr 2009 18:41:08 -0700
From: Kevin Cernekee <cernekee@gmail.com>
To: "ralf@linux-mips.org" <ralf@linux-mips.org>
CC: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Thu, 23 Apr 2009 17:25:12 -0700
Subject: [PATCH 2/3] MIPS: Pass struct device to plat_dma_addr_to_phys()
Thread-Topic: [PATCH 2/3] MIPS: Pass struct device to plat_dma_addr_to_phys()
Thread-Index: AcnEfeuEyGUr1Rn5TKi5oUOt8VCPyw==
Message-ID:
 <5c7b8b1a0a84568adda890e80355f45211fd4727.1240533480.git@localhost>
References:
 <0483452db22e72f57289e63fcf097120d94c2a37.1240533480.git@localhost>
In-Reply-To:
 <0483452db22e72f57289e63fcf097120d94c2a37.1240533480.git@localhost>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 0b
X-MS-Exchange-Organization-AuthSource: exch1.onstor.net
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-originalarrivaltime: 24 Apr 2009 01:42:22.0900 (UTC)
 FILETIME=[E9C92740:01C9C47D]
errors-to: linux-mips-bounce@linux-mips.org
x-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-pstn-neptune: 0/0/0.00/0
x-ems-proccessed: 2K3Xl1OQTInXD6xxuA8z3Q==
x-ems-stamp: NQ3b4+bC8bBGIIRCz+iwEg==
x-list: linux-mips
x-archive-position: 22452
x-ecartis-version: Ecartis v1.0.0
x-original-sender: cernekee@gmail.com
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 .../include/asm/mach-cavium-octeon/dma-coherence.h |    3 ++-
 arch/mips/include/asm/mach-generic/dma-coherence.h |    3 ++-
 arch/mips/include/asm/mach-ip27/dma-coherence.h    |    3 ++-
 arch/mips/include/asm/mach-ip32/dma-coherence.h    |    3 ++-
 arch/mips/include/asm/mach-jazz/dma-coherence.h    |    3 ++-
 arch/mips/include/asm/mach-lemote/dma-coherence.h  |    3 ++-
 arch/mips/mm/dma-default.c                         |   15 ++++++++-------
 7 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h b/arc=
h/mips/include/asm/mach-cavium-octeon/dma-coherence.h
index 7289e67..17d5794 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
@@ -30,7 +30,8 @@ static inline dma_addr_t plat_map_dma_mem_page(struct dev=
ice *dev,
 	return octeon_map_dma_mem(dev, page_address(page), PAGE_SIZE);
 }
=20
-static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
+static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
+	dma_addr_t dma_addr)
 {
 	return dma_addr;
 }
diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips=
/include/asm/mach-generic/dma-coherence.h
index 804c2de..8da9807 100644
--- a/arch/mips/include/asm/mach-generic/dma-coherence.h
+++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
@@ -23,7 +23,8 @@ static inline dma_addr_t plat_map_dma_mem_page(struct dev=
ice *dev,
 	return page_to_phys(page);
 }
=20
-static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
+static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
+	dma_addr_t dma_addr)
 {
 	return dma_addr;
 }
diff --git a/arch/mips/include/asm/mach-ip27/dma-coherence.h b/arch/mips/in=
clude/asm/mach-ip27/dma-coherence.h
index 8676673..d3d0401 100644
--- a/arch/mips/include/asm/mach-ip27/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h
@@ -33,7 +33,8 @@ static dma_addr_t plat_map_dma_mem_page(struct device *de=
v, struct page *page)
 	return pa;
 }
=20
-static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
+static unsigned long plat_dma_addr_to_phys(struct device *dev,
+	dma_addr_t dma_addr)
 {
 	return dma_addr & ~(0xffUL << 56);
 }
diff --git a/arch/mips/include/asm/mach-ip32/dma-coherence.h b/arch/mips/in=
clude/asm/mach-ip32/dma-coherence.h
index d41805e..3785595 100644
--- a/arch/mips/include/asm/mach-ip32/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h
@@ -50,7 +50,8 @@ static dma_addr_t plat_map_dma_mem_page(struct device *de=
v, struct page *page)
 }
=20
 /* This is almost certainly wrong but it's what dma-ip32.c used to use  */
-static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
+static unsigned long plat_dma_addr_to_phys(struct device *dev,
+	dma_addr_t dma_addr)
 {
 	unsigned long addr =3D dma_addr & RAM_OFFSET_MASK;
=20
diff --git a/arch/mips/include/asm/mach-jazz/dma-coherence.h b/arch/mips/in=
clude/asm/mach-jazz/dma-coherence.h
index 5f3d7ea..f93aee5 100644
--- a/arch/mips/include/asm/mach-jazz/dma-coherence.h
+++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h
@@ -22,7 +22,8 @@ static dma_addr_t plat_map_dma_mem_page(struct device *de=
v, struct page *page)
 	return vdma_alloc(page_to_phys(page), PAGE_SIZE);
 }
=20
-static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
+static unsigned long plat_dma_addr_to_phys(struct device *dev,
+	dma_addr_t dma_addr)
 {
 	return vdma_log2phys(dma_addr);
 }
diff --git a/arch/mips/include/asm/mach-lemote/dma-coherence.h b/arch/mips/=
include/asm/mach-lemote/dma-coherence.h
index c78f1d8..c8de5e7 100644
--- a/arch/mips/include/asm/mach-lemote/dma-coherence.h
+++ b/arch/mips/include/asm/mach-lemote/dma-coherence.h
@@ -25,7 +25,8 @@ static inline dma_addr_t plat_map_dma_mem_page(struct dev=
ice *dev,
 	return page_to_phys(page) | 0x80000000;
 }
=20
-static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
+static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
+	dma_addr_t dma_addr)
 {
 	return dma_addr & 0x7fffffff;
 }
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 30b108c..7e48e76 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -20,9 +20,10 @@
=20
 #include <dma-coherence.h>
=20
-static inline unsigned long dma_addr_to_virt(dma_addr_t dma_addr)
+static inline unsigned long dma_addr_to_virt(struct device *dev,
+	dma_addr_t dma_addr)
 {
-	unsigned long addr =3D plat_dma_addr_to_phys(dma_addr);
+	unsigned long addr =3D plat_dma_addr_to_phys(dev, dma_addr);
=20
 	return (unsigned long)phys_to_virt(addr);
 }
@@ -170,7 +171,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dm=
a_addr, size_t size,
 	enum dma_data_direction direction)
 {
 	if (cpu_is_noncoherent_r10000(dev))
-		__dma_sync(dma_addr_to_virt(dma_addr), size,
+		__dma_sync(dma_addr_to_virt(dev, dma_addr), size,
 		           direction);
=20
 	plat_unmap_dma_mem(dev, dma_addr, size, direction);
@@ -246,7 +247,7 @@ void dma_sync_single_for_cpu(struct device *dev, dma_ad=
dr_t dma_handle,
 	if (cpu_is_noncoherent_r10000(dev)) {
 		unsigned long addr;
=20
-		addr =3D dma_addr_to_virt(dma_handle);
+		addr =3D dma_addr_to_virt(dev, dma_handle);
 		__dma_sync(addr, size, direction);
 	}
 }
@@ -262,7 +263,7 @@ void dma_sync_single_for_device(struct device *dev, dma=
_addr_t dma_handle,
 	if (!plat_device_is_coherent(dev)) {
 		unsigned long addr;
=20
-		addr =3D dma_addr_to_virt(dma_handle);
+		addr =3D dma_addr_to_virt(dev, dma_handle);
 		__dma_sync(addr, size, direction);
 	}
 }
@@ -277,7 +278,7 @@ void dma_sync_single_range_for_cpu(struct device *dev, =
dma_addr_t dma_handle,
 	if (cpu_is_noncoherent_r10000(dev)) {
 		unsigned long addr;
=20
-		addr =3D dma_addr_to_virt(dma_handle);
+		addr =3D dma_addr_to_virt(dev, dma_handle);
 		__dma_sync(addr + offset, size, direction);
 	}
 }
@@ -293,7 +294,7 @@ void dma_sync_single_range_for_device(struct device *de=
v, dma_addr_t dma_handle,
 	if (!plat_device_is_coherent(dev)) {
 		unsigned long addr;
=20
-		addr =3D dma_addr_to_virt(dma_handle);
+		addr =3D dma_addr_to_virt(dev, dma_handle);
 		__dma_sync(addr + offset, size, direction);
 	}
 }
--=20
1.5.3.6


