diff for duplicates of <5225DC8E.7070001@codethink.co.uk> diff --git a/a/1.txt b/N1/1.txt index d9bd3fa..6238559 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -242,8 +242,7 @@ couldn't find these being used, can they be removed? > + > +static void em_i2c_reset(struct i2c_adapter *adap) > +{ -> + struct em_i2c_device *i2c_dev = -> + (struct em_i2c_device *)(i2c_get_adapdata(adap)); +> + struct em_i2c_device *i2c_dev > + (struct em_i2c_device *)(i2c_get_adapdata(adap)); > + > + /* If I2C active */ > + if (readl(i2c_dev->membase + I2C_OFS_IICACT0)& I2C_BIT_IICE0) { @@ -251,7 +250,7 @@ couldn't find these being used, can they be removed? > + /* Disable I2C operation */ > + writel(0, i2c_dev->membase + I2C_OFS_IICACT0); > + -> + while (readl(i2c_dev->membase + I2C_OFS_IICACT0) == 1) +> + while (readl(i2c_dev->membase + I2C_OFS_IICACT0) = 1) > + ; > + } > + @@ -268,15 +267,14 @@ couldn't find these being used, can they be removed? > + /* Enable I2C operation */ > + writel(I2C_BIT_IICE0, i2c_dev->membase + I2C_OFS_IICACT0); > + -> + while (readl(i2c_dev->membase + I2C_OFS_IICACT0) == 0) +> + while (readl(i2c_dev->membase + I2C_OFS_IICACT0) = 0) > + ; > +} > + > +static int __em_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, > + int stop) > +{ -> + struct em_i2c_device *i2c_dev = -> + (struct em_i2c_device *)i2c_get_adapdata(adap); +> + struct em_i2c_device *i2c_dev > + (struct em_i2c_device *)i2c_get_adapdata(adap); > + int count = 0; > + u16 status; > + @@ -335,11 +333,10 @@ couldn't find these being used, can they be removed? > + if (!(msg->flags& I2C_M_RD)) > + goto out_reset; > + -> + if (count == msg->len) +> + if (count = msg->len) > + break; > + -> + msg->buf[count++] = -> + readl(i2c_dev->membase + I2C_OFS_IIC0); +> + msg->buf[count++] > + readl(i2c_dev->membase + I2C_OFS_IIC0); > + > + > + writel((readl(i2c_dev->membase + I2C_OFS_IICC0) @@ -358,7 +355,7 @@ couldn't find these being used, can they be removed? > + goto out; > + } > + -> + if (count == msg->len) +> + if (count = msg->len) > + break; > + > + /* Write data */ @@ -408,8 +405,7 @@ couldn't find these being used, can they be removed? > +static int em_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, > + int num) > +{ -> + struct em_i2c_device *i2c_dev = -> + (struct em_i2c_device *)(i2c_get_adapdata(adap)); +> + struct em_i2c_device *i2c_dev > + (struct em_i2c_device *)(i2c_get_adapdata(adap)); if this is used enough it may have been easier to add an to_em_i2c() macro. @@ -417,11 +413,11 @@ macro. > + int ret = 0; > + int i; > + -> + if (msgs == NULL) +> + if (msgs = NULL) > + return -EINVAL; > + > + for (i = 0; i< num; i++) -> + if (msgs[i].buf == NULL) +> + if (msgs[i].buf = NULL) > + return -EINVAL; do we really need this check? does the core validate the @@ -457,7 +453,7 @@ to do this from a driver? > + > + /* Send messages */ > + for (i = 0; i< num; i++) { -> + ret = __em_i2c_xfer(adap,&msgs[i], (i == (num - 1))); +> + ret = __em_i2c_xfer(adap,&msgs[i], (i = (num - 1))); > + if (ret< 0) > + goto out; > + } diff --git a/a/content_digest b/N1/content_digest index 2cb9843..2bebbb8 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -3,7 +3,7 @@ "ref\01378207832-3412-2-git-send-email-ian.molton@codethink.co.uk\0" "From\0Ben Dooks <ben.dooks@codethink.co.uk>\0" "Subject\0Re: [PATCH] EMMA: Add em i2c driver\0" - "Date\0Tue, 03 Sep 2013 13:56:46 +0100\0" + "Date\0Tue, 03 Sep 2013 12:56:46 +0000\0" "To\0Ian Molton <ian.molton@codethink.co.uk>\0" "Cc\0magnus.damm@gmail.com" grant.likely@linaro.org @@ -257,8 +257,7 @@ "> +\n" "> +static void em_i2c_reset(struct i2c_adapter *adap)\n" "> +{\n" - "> +\tstruct em_i2c_device *i2c_dev =\n" - "> +\t\t(struct em_i2c_device *)(i2c_get_adapdata(adap));\n" + "> +\tstruct em_i2c_device *i2c_dev > +\t\t(struct em_i2c_device *)(i2c_get_adapdata(adap));\n" "> +\n" "> +\t/* If I2C active */\n" "> +\tif (readl(i2c_dev->membase + I2C_OFS_IICACT0)& I2C_BIT_IICE0) {\n" @@ -266,7 +265,7 @@ "> +\t\t/* Disable I2C operation */\n" "> +\t\twritel(0, i2c_dev->membase + I2C_OFS_IICACT0);\n" "> +\n" - "> +\t\twhile (readl(i2c_dev->membase + I2C_OFS_IICACT0) == 1)\n" + "> +\t\twhile (readl(i2c_dev->membase + I2C_OFS_IICACT0) = 1)\n" "> +\t\t\t;\n" "> +\t}\n" "> +\n" @@ -283,15 +282,14 @@ "> +\t/* Enable I2C operation */\n" "> +\twritel(I2C_BIT_IICE0, i2c_dev->membase + I2C_OFS_IICACT0);\n" "> +\n" - "> +\twhile (readl(i2c_dev->membase + I2C_OFS_IICACT0) == 0)\n" + "> +\twhile (readl(i2c_dev->membase + I2C_OFS_IICACT0) = 0)\n" "> +\t\t;\n" "> +}\n" "> +\n" "> +static int __em_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,\n" "> +\t\t\t\tint stop)\n" "> +{\n" - "> +\tstruct em_i2c_device *i2c_dev =\n" - "> +\t\t(struct em_i2c_device *)i2c_get_adapdata(adap);\n" + "> +\tstruct em_i2c_device *i2c_dev > +\t\t(struct em_i2c_device *)i2c_get_adapdata(adap);\n" "> +\tint count = 0;\n" "> +\tu16 status;\n" "> +\n" @@ -350,11 +348,10 @@ "> +\t\t\tif (!(msg->flags& I2C_M_RD))\n" "> +\t\t\t\tgoto out_reset;\n" "> +\n" - "> +\t\t\tif (count == msg->len)\n" + "> +\t\t\tif (count = msg->len)\n" "> +\t\t\t\tbreak;\n" "> +\n" - "> +\t\t\tmsg->buf[count++] =\n" - "> +\t\t\t\treadl(i2c_dev->membase + I2C_OFS_IIC0);\n" + "> +\t\t\tmsg->buf[count++] > +\t\t\t\treadl(i2c_dev->membase + I2C_OFS_IIC0);\n" "> +\n" "> +\n" "> +\t\t\twritel((readl(i2c_dev->membase + I2C_OFS_IICC0)\n" @@ -373,7 +370,7 @@ "> +\t\t\t\tgoto out;\n" "> +\t\t\t}\n" "> +\n" - "> +\t\t\tif (count == msg->len)\n" + "> +\t\t\tif (count = msg->len)\n" "> +\t\t\t\tbreak;\n" "> +\n" "> +\t\t\t/* Write data */\n" @@ -423,8 +420,7 @@ "> +static int em_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,\n" "> +\tint num)\n" "> +{\n" - "> +\tstruct em_i2c_device *i2c_dev =\n" - "> +\t\t(struct em_i2c_device *)(i2c_get_adapdata(adap));\n" + "> +\tstruct em_i2c_device *i2c_dev > +\t\t(struct em_i2c_device *)(i2c_get_adapdata(adap));\n" "\n" "if this is used enough it may have been easier to add an to_em_i2c()\n" "macro.\n" @@ -432,11 +428,11 @@ "> +\tint ret = 0;\n" "> +\tint i;\n" "> +\n" - "> +\tif (msgs == NULL)\n" + "> +\tif (msgs = NULL)\n" "> +\t\treturn -EINVAL;\n" "> +\n" "> +\tfor (i = 0; i< num; i++)\n" - "> +\t\tif (msgs[i].buf == NULL)\n" + "> +\t\tif (msgs[i].buf = NULL)\n" "> +\t\t\treturn -EINVAL;\n" "\n" "do we really need this check? does the core validate the\n" @@ -472,7 +468,7 @@ "> +\n" "> +\t/* Send messages */\n" "> +\tfor (i = 0; i< num; i++) {\n" - "> +\t\tret = __em_i2c_xfer(adap,&msgs[i], (i == (num - 1)));\n" + "> +\t\tret = __em_i2c_xfer(adap,&msgs[i], (i = (num - 1)));\n" "> +\t\tif (ret< 0)\n" "> +\t\t\tgoto out;\n" "> +\t}\n" @@ -629,4 +625,4 @@ "Ben Dooks\t\t\t\thttp://www.codethink.co.uk/\n" "Senior Engineer\t\t\t\tCodethink - Providing Genius" -8a05ea2c724330c268cfc3ecba3b4657e8dd2185d06436720da0eb4e00713c5f +2ccb073f00a15259534ef6ea2e75d7d1709d341ca1f0d59b96a85bc8b478a792
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.