Re: [PATCH] rtc: rs5c313: Replase from ctrl_* to __raw_*

From: Harvey Harrison
Date: Fri Oct 22 2010 - 18:09:13 EST


On Fri, Oct 22, 2010 at 3:01 PM, Nobuhiro Iwamatsu <iwamatsu@xxxxxxxxxxx> wrote:
> ctrl_* is deprecated. We should to use __raw_*.
>

>
> Â Â Â Â/* And Initialize SCL for RS5C313 clock */
> - Â Â Â scsptr1_data = ctrl_inb(SCSPTR1) | SCL; /* SCL:H */
> - Â Â Â ctrl_outb(scsptr1_data, SCSPTR1);
> - Â Â Â scsptr1_data = ctrl_inb(SCSPTR1) | SCL_OEN; Â Â /* SCL output enable */
> - Â Â Â ctrl_outb(scsptr1_data, SCSPTR1);
> + Â Â Â scsptr1_data = __raw_readb(SCSPTR1) | SCL; Â Â Â/* SCL:H */
> + Â Â Â __raw_writeb(scsptr1_data, SCSPTR1);
> + Â Â Â scsptr1_data = __raw_readb(SCSPTR1) | SCL_OEN; Â/* SCL output enable */
> + Â Â Â __raw_writeb(scsptr1_data, SCSPTR1);
> Â Â Â ÂRS5C313_CEDISABLE; Â Â Â/* CE:L */
> Â}

I think that you need a barrier between write and the subsequent read
as the __raw helpers do not
imply one. Otherwise the write isn't guaranteed to be done before the read.

Harvey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/