int msm_ssbi_write(struct device *dev, u16 addr, u8 *buf, int len)
{
	struct msm_ssbi *ssbi = to_msm_ssbi(dev);
	unsigned long flags;
	int ret;

	if (ssbi->dev != dev)
		return -ENXIO;

	if (ssbi->use_rlock) {
		remote_spin_lock_irqsave(&ssbi->rspin_lock, flags);
		ret = ssbi->write(ssbi, addr, buf, len);
		remote_spin_unlock_irqrestore(&ssbi->rspin_lock, flags);
	} else {
		spin_lock_irqsave(&ssbi->lock, flags);
		ret = ssbi->write(ssbi, addr, buf, len);
		spin_unlock_irqrestore(&ssbi->lock, flags);
	}

	return ret;
}