diff mbox

[03/10] usb: phy: mv-u3d: switch over to writel/readl

Message ID 1398095812-14222-4-git-send-email-balbi@ti.com
State Accepted
Commit 041832565e405d2e2ea218632b7bcafa87deaece
Headers show

Commit Message

Felipe Balbi April 21, 2014, 3:56 p.m. UTC
by removing the _relaxed suffix, we can build
this driver in other architectures.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/phy/phy-mv-u3d-usb.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Greg KH April 21, 2014, 7:04 p.m. UTC | #1
On Mon, Apr 21, 2014 at 10:56:45AM -0500, Felipe Balbi wrote:
> by removing the _relaxed suffix, we can build
> this driver in other architectures.

Odd, why was the _relaxed variants used here at all?  Someone trying to
optimize something ahead of time?

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Felipe Balbi April 21, 2014, 7:06 p.m. UTC | #2
On Mon, Apr 21, 2014 at 12:04:44PM -0700, Greg KH wrote:
> On Mon, Apr 21, 2014 at 10:56:45AM -0500, Felipe Balbi wrote:
> > by removing the _relaxed suffix, we can build
> > this driver in other architectures.
> 
> Odd, why was the _relaxed variants used here at all?  Someone trying to
> optimize something ahead of time?

that has been there since its inception in commit
a67e76ac904cb48946262bf353f1df0d1b349368. My guess is that someone
wanted to avoid the memory barriers imposed by writel()/readl().
diff mbox

Patch

diff --git a/drivers/usb/phy/phy-mv-u3d-usb.c b/drivers/usb/phy/phy-mv-u3d-usb.c
index d317903..d342175 100644
--- a/drivers/usb/phy/phy-mv-u3d-usb.c
+++ b/drivers/usb/phy/phy-mv-u3d-usb.c
@@ -39,8 +39,8 @@  static u32 mv_u3d_phy_read(void __iomem *base, u32 reg)
 	addr = base;
 	data = base + 0x4;
 
-	writel_relaxed(reg, addr);
-	return readl_relaxed(data);
+	writel(reg, addr);
+	return readl(data);
 }
 
 static void mv_u3d_phy_set(void __iomem *base, u32 reg, u32 value)
@@ -51,10 +51,10 @@  static void mv_u3d_phy_set(void __iomem *base, u32 reg, u32 value)
 	addr = base;
 	data = base + 0x4;
 
-	writel_relaxed(reg, addr);
-	tmp = readl_relaxed(data);
+	writel(reg, addr);
+	tmp = readl(data);
 	tmp |= value;
-	writel_relaxed(tmp, data);
+	writel(tmp, data);
 }
 
 static void mv_u3d_phy_clear(void __iomem *base, u32 reg, u32 value)
@@ -65,10 +65,10 @@  static void mv_u3d_phy_clear(void __iomem *base, u32 reg, u32 value)
 	addr = base;
 	data = base + 0x4;
 
-	writel_relaxed(reg, addr);
-	tmp = readl_relaxed(data);
+	writel(reg, addr);
+	tmp = readl(data);
 	tmp &= ~value;
-	writel_relaxed(tmp, data);
+	writel(tmp, data);
 }
 
 static void mv_u3d_phy_write(void __iomem *base, u32 reg, u32 value)
@@ -78,8 +78,8 @@  static void mv_u3d_phy_write(void __iomem *base, u32 reg, u32 value)
 	addr = base;
 	data = base + 0x4;
 
-	writel_relaxed(reg, addr);
-	writel_relaxed(value, data);
+	writel(reg, addr);
+	writel(value, data);
 }
 
 static void mv_u3d_phy_shutdown(struct usb_phy *phy)