Discussion:
[PATCH] usb: chipidea: usbmisc_imx: Move the reading of USB_PHY_CTRL
Fabio Estevam
2014-10-20 14:35:47 UTC
Permalink
If 'evdo' property is not defined, then reading the MX25_USB_PHY_CTRL_OFFSET
register is an unneeded operation.

Move the reading of MX25_USB_PHY_CTRL_OFFSET inside the 'evdo' if block code,
where it is actually used.

Signed-off-by: Fabio Estevam <fabio.estevam-***@public.gmane.org>
---
drivers/usb/chipidea/usbmisc_imx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 926c997..29200eb 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -117,10 +117,9 @@ static int usbmisc_imx25_post(struct imx_usbmisc_data *data)
if (data->index > 2)
return -EINVAL;

- reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
Peter Chen
2014-10-21 01:10:49 UTC
Permalink
Post by Fabio Estevam
If 'evdo' property is not defined, then reading the
MX25_USB_PHY_CTRL_OFFSET register is an unneeded operation.
Move the reading of MX25_USB_PHY_CTRL_OFFSET inside the 'evdo' if block
code, where it is actually used.
---
drivers/usb/chipidea/usbmisc_imx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/chipidea/usbmisc_imx.c
b/drivers/usb/chipidea/usbmisc_imx.c
index 926c997..29200eb 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -117,10 +117,9 @@ static int usbmisc_imx25_post(struct
imx_usbmisc_data *data)
if (data->index > 2)
return -EINVAL;
- reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
-
if (data->evdo) {
spin_lock_irqsave(&usbmisc->lock, flags);
+ reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
val = readl(reg);
writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
spin_unlock_irqrestore(&usbmisc->lock, flags);
--
1.9.1
Applied, Thanks.

Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...