[PATCH] s390: improve response code handling in chsc_enable_facility()
authorCornelia Huck <cornelia.huck@de.ibm.com>
Mon, 6 Mar 2006 23:43:02 +0000 (15:43 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 7 Mar 2006 02:40:45 +0000 (18:40 -0800)
Rather than checking for some known failures, check positively for the
success response code 0x0001 and return -EIO for unrecognized failure
response codes.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Greg Smith <gsmith@nc.rr.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/s390/cio/chsc.c

index 8cf9905d484be5fc120b2e05a65103f0acad95c9..f4183d660258108728a626b73c22798ba4699570 100644 (file)
@@ -1115,6 +1115,9 @@ chsc_enable_facility(int operation_code)
                goto out;
        }
        switch (sda_area->response.code) {
+       case 0x0001: /* everything ok */
+               ret = 0;
+               break;
        case 0x0003: /* invalid request block */
        case 0x0007:
                ret = -EINVAL;
@@ -1123,6 +1126,8 @@ chsc_enable_facility(int operation_code)
        case 0x0101: /* facility not provided */
                ret = -EOPNOTSUPP;
                break;
+       default: /* something went wrong */
+               ret = -EIO;
        }
  out:
        free_page((unsigned long)sda_area);