[PATCH 4/9] usb: imx-usb-phy: Drop unnecessary read/modify/write

Sascha Hauer s.hauer at pengutronix.de
Thu Sep 29 05:38:55 PDT 2016


When writing to the USBPHY_CTRL register read/modify/write is unncessary
since we are writing to the associated bit set register anyway.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/usb/imx/imx-usb-phy.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/imx/imx-usb-phy.c b/drivers/usb/imx/imx-usb-phy.c
index 1aa12be..eec195d 100644
--- a/drivers/usb/imx/imx-usb-phy.c
+++ b/drivers/usb/imx/imx-usb-phy.c
@@ -39,8 +39,6 @@ struct imx_usbphy {
 
 static int imx_usbphy_enable(struct imx_usbphy *imxphy)
 {
-	u32 val;
-
 	clk_enable(imxphy->clk);
 
 	/* reset usbphy */
@@ -56,9 +54,8 @@ static int imx_usbphy_enable(struct imx_usbphy *imxphy)
 	writel(0xffffffff, imxphy->base + CLR);
 
 	/* set utmilvl2/3 */
-	val = readl(imxphy->base + USBPHY_CTRL);
-	val |= USBPHY_CTRL_ENUTMILEVEL3 | USBPHY_CTRL_ENUTMILEVEL2;
-	writel(val, imxphy->base + USBPHY_CTRL + SET);
+	writel(USBPHY_CTRL_ENUTMILEVEL3 | USBPHY_CTRL_ENUTMILEVEL2,
+	       imxphy->base + USBPHY_CTRL + SET);
 
 	return 0;
 }
-- 
2.9.3




More information about the barebox mailing list