nios2: use builtin functions for control registers access

The commit 51926d5ee0
  COMMON: Use __stringify() instead of rest of implementations
forgot to update the wrctl funtion, and causes compilation error.

But there are builtin functions for control registers access in
nios2 comipiler. It is convenient to use them instead.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Cc: Marek Vasut <marex@denx.de>
This commit is contained in:
Thomas Chou 2012-11-09 14:29:15 +08:00
parent 59852d0386
commit 4f63bfb689

View File

@ -24,8 +24,6 @@
#ifndef __NIOS2_H__
#define __NIOS2_H__
#include <linux/stringify.h>
/*------------------------------------------------------------------------
* Control registers -- use with wrctl() & rdctl()
*----------------------------------------------------------------------*/
@ -39,14 +37,8 @@
* Access to control regs
*----------------------------------------------------------------------*/
#define rdctl(reg)\
({unsigned int val;\
asm volatile("rdctl %0, ctl" __stringify(reg) \
: "=r" (val) ); val;})
#define wrctl(reg,val)\
asm volatile( "wrctl ctl" _str_(reg) ",%0"\
: : "r" (val))
#define rdctl(reg) __builtin_rdctl(reg)
#define wrctl(reg, val) __builtin_wrctl(reg, val)
/*------------------------------------------------------------------------
* Control reg bit masks