]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
i2c: opal: don't check number of messages in the driver
authorWolfram Sang <wsa@the-dreams.de>
Sun, 20 May 2018 06:50:34 +0000 (08:50 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 24 May 2018 20:06:17 +0000 (22:06 +0200)
Since commit 1eace8344c02 ("i2c: add param sanity check to
i2c_transfer()") and b7f625840267 ("i2c: add quirk checks to core"), the
I2C core does this check now. We can remove it here.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Reviewed-by: Peter Rosin <peda@axentia.se>
drivers/i2c/busses/i2c-opal.c

index 0aabb7eca0c552968df67bd39aa81db9de009131..dc2a23f4fb52f354e8914dce6335e09a9d8383a9 100644 (file)
@@ -94,8 +94,6 @@ static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
         */
        memset(&req, 0, sizeof(req));
        switch(num) {
-       case 0:
-               return 0;
        case 1:
                req.type = (msgs[0].flags & I2C_M_RD) ?
                        OPAL_I2C_RAW_READ : OPAL_I2C_RAW_WRITE;
@@ -114,8 +112,6 @@ static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
                req.size = cpu_to_be32(msgs[1].len);
                req.buffer_ra = cpu_to_be64(__pa(msgs[1].buf));
                break;
-       default:
-               return -EOPNOTSUPP;
        }
 
        rc = i2c_opal_send_request(opal_id, &req);