]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/i2c/busses/i2c-cpm.c
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / drivers / i2c / busses / i2c-cpm.c
index b167ab25310a3b53797a8604d0adf360d91fb3e9..d89bde2c5da256ecff87c4bd6ba1fc6fc3a2f4b0 100644 (file)
@@ -197,9 +197,7 @@ static void cpm_i2c_parse_message(struct i2c_adapter *adap,
        tbdf = cpm->tbase + tx;
        rbdf = cpm->rbase + rx;
 
-       addr = pmsg->addr << 1;
-       if (pmsg->flags & I2C_M_RD)
-               addr |= 1;
+       addr = i2c_8bit_addr_from_msg(pmsg);
 
        tb = cpm->txbuf[tx];
        rb = cpm->rxbuf[rx];
@@ -667,10 +665,8 @@ static int cpm_i2c_probe(struct platform_device *ofdev)
        cpm->adap.nr = (data && len == 4) ? be32_to_cpup(data) : -1;
        result = i2c_add_numbered_adapter(&cpm->adap);
 
-       if (result < 0) {
-               dev_err(&ofdev->dev, "Unable to register with I2C\n");
+       if (result < 0)
                goto out_shut;
-       }
 
        dev_dbg(&ofdev->dev, "hw routines for %s registered.\n",
                cpm->adap.name);