On Wed, Aug 07, 2013 at 01:34:37PM +0800, Peter Chen wrote:
> -
> -     reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
> -
> -     if (usbdev->evdo) {
> -             spin_lock_irqsave(&usbmisc->lock, flags);
> -             val = readl(reg);
> -             writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
> -             spin_unlock_irqrestore(&usbmisc->lock, flags);
> +     if (data->evdo) {
> +             spin_lock_irqsave(&data->lock, flags);
> +             regmap_read(data->non_core_base_addr,
> +                             MX25_USB_PHY_CTRL_OFFSET, &val);
> +             regmap_write(data->non_core_base_addr,
> +                             MX25_USB_PHY_CTRL_OFFSET,
> +                                     val | MX25_BM_EXTERNAL_VBUS_DIVIDER);
> +             spin_unlock_irqrestore(&data->lock, flags);

Have a look at regmap_update_bits. You won't need this spinlock anymore.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to