GRSPW: fixed SET_RMAPEN and SET_RMAPBUFDIS

Both ioctl commands destroyed the control register by writing the
content of the status register into it.
This commit is contained in:
Daniel Hellstrom
2015-04-17 01:10:18 +02:00
parent 4d249b9fed
commit 5dd83de944
+2 -2
View File
@@ -1138,7 +1138,7 @@ static rtems_device_driver grspw_control(
if ((unsigned int)ioarg->buffer > 1) {
return RTEMS_INVALID_NAME;
}
SPW_CTRL_WRITE(pDev, (SPW_STATUS_READ(pDev) & 0xFFFEFFFF) | ((unsigned int)ioarg->buffer << 16));
SPW_CTRL_WRITE(pDev, (SPW_CTRL_READ(pDev) & 0xFFFEFFFF) | ((unsigned int)ioarg->buffer << 16));
if (((SPW_CTRL_READ(pDev) >> 16) & 1) != (unsigned int)ioarg->buffer) {
return RTEMS_IO_ERROR;
}
@@ -1149,7 +1149,7 @@ static rtems_device_driver grspw_control(
if ((unsigned int)ioarg->buffer > 1) {
return RTEMS_INVALID_NAME;
}
SPW_CTRL_WRITE(pDev, (SPW_STATUS_READ(pDev) & 0xFFFDFFFF) | ((unsigned int)ioarg->buffer << 17));
SPW_CTRL_WRITE(pDev, (SPW_CTRL_READ(pDev) & 0xFFFDFFFF) | ((unsigned int)ioarg->buffer << 17));
if (((SPW_CTRL_READ(pDev) >> 17) & 1) != (unsigned int)ioarg->buffer) {
return RTEMS_IO_ERROR;
}