+ opencores-i2c-bus-driver-tidy.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     opencores-i2c-bus-driver-tidy

has been added to the -mm tree.  Its filename is

     opencores-i2c-bus-driver-tidy.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this


From: Andrew Morton <akpm@xxxxxxxx>

- Basic coding-syle fixes.

- ocores_xfer() doesn't seem to correctly handle a -ERESTARTSYS from
  wait_event_interruptible_timeout().

- ocores_i2c_probe() might be ioremap()ping and release_mem_region()ing one
  byte too many.

- ditto ocores_i2c_remove()

Cc: Peter Korsgaard <jacmet@xxxxxxxxxx>
Cc: Jean Delvare <khali@xxxxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/i2c/busses/i2c-ocores.c |   58 ++++++++++--------------------
 include/linux/i2c-ocores.h      |    1 
 i2c/busses/Kconfig              |    0 
 i2c/busses/Makefile             |    0 
 4 files changed, 20 insertions(+), 39 deletions(-)

diff -puN drivers/i2c/busses/i2c-ocores.c~opencores-i2c-bus-driver-tidy drivers/i2c/busses/i2c-ocores.c
--- 25/drivers/i2c/busses/i2c-ocores.c~opencores-i2c-bus-driver-tidy	Fri Apr 21 14:11:41 2006
+++ 25-akpm/drivers/i2c/busses/i2c-ocores.c	Fri Apr 21 14:11:41 2006
@@ -62,12 +62,12 @@ struct ocores_i2c {
 #define STATE_READ  3
 #define STATE_ERROR 4
 
-static __inline__ void oc_setreg(struct ocores_i2c *i2c, int reg, u8 value)
+static inline void oc_setreg(struct ocores_i2c *i2c, int reg, u8 value)
 {
 	iowrite8(value, i2c->base + reg * i2c->regstep);
 }
 
-static __inline__ u8 oc_getreg(struct ocores_i2c *i2c, int reg)
+static inline u8 oc_getreg(struct ocores_i2c *i2c, int reg)
 {
 	return ioread8(i2c->base + reg * i2c->regstep);
 }
@@ -77,8 +77,7 @@ static void ocores_process(struct ocores
 	struct i2c_msg *msg = i2c->msg;
 	u8 stat = oc_getreg(i2c, OCI2C_STATUS);
 
-	if ((i2c->state == STATE_DONE) || (i2c->state == STATE_ERROR))
-	{
+	if ((i2c->state == STATE_DONE) || (i2c->state == STATE_ERROR)) {
 		/* stop has been sent */
 		oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK);
 		wake_up_interruptible(&i2c->wait);
@@ -86,41 +85,34 @@ static void ocores_process(struct ocores
 	}
 
 	/* error? */
-	if (stat & OCI2C_STAT_ARBLOST)
-	{
+	if (stat & OCI2C_STAT_ARBLOST) {
 		i2c->state = STATE_ERROR;
 		oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP);
 		return;
 	}
 
-	if ((i2c->state == STATE_START) || (i2c->state == STATE_WRITE))
-	{
+	if ((i2c->state == STATE_START) || (i2c->state == STATE_WRITE)) {
 		i2c->state =
 			(msg->flags & I2C_M_RD) ? STATE_READ : STATE_WRITE;
 
-		if (stat & OCI2C_STAT_NACK)
-		{
+		if (stat & OCI2C_STAT_NACK) {
 			i2c->state = STATE_ERROR;
 			oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP);
 			return;
 		}
-	}
-	else
+	} else
 		msg->buf[i2c->pos++] = oc_getreg(i2c, OCI2C_DATA);
 
 	/* end of msg? */
-	if (i2c->pos == msg->len)
-	{
+	if (i2c->pos == msg->len) {
 		i2c->nmsgs--;
 		i2c->msg++;
 		i2c->pos = 0;
 		msg = i2c->msg;
 
-		if (i2c->nmsgs) /* end? */
-		{
+		if (i2c->nmsgs) {	/* end? */
 			/* send start? */
-			if (!(msg->flags & I2C_M_NOSTART))
-			{
+			if (!(msg->flags & I2C_M_NOSTART)) {
 				u8 addr = (msg->addr << 1);
 
 				if (msg->flags & I2C_M_RD)
@@ -131,26 +123,20 @@ static void ocores_process(struct ocores
 				oc_setreg(i2c, OCI2C_DATA, addr);
 				oc_setreg(i2c, OCI2C_CMD,  OCI2C_CMD_START);
 				return;
-			}
-			else
+			} else
 				i2c->state = (msg->flags & I2C_M_RD)
 					? STATE_READ : STATE_WRITE;
-		}
-		else
-		{
+		} else {
 			i2c->state = STATE_DONE;
 			oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP);
 			return;
 		}
 	}
 
-	if (i2c->state == STATE_READ)
-	{
+	if (i2c->state == STATE_READ) {
 		oc_setreg(i2c, OCI2C_CMD, i2c->pos == (msg->len-1) ?
 			  OCI2C_CMD_READ_NACK : OCI2C_CMD_READ_ACK);
-	}
-	else
-	{
+	} else {
 		oc_setreg(i2c, OCI2C_DATA, msg->buf[i2c->pos++]);
 		oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_WRITE);
 	}
@@ -228,8 +214,8 @@ static struct i2c_adapter ocores_adapter
 
 static int __devinit ocores_i2c_probe(struct platform_device *pdev)
 {
-	struct ocores_i2c* i2c;
-	struct ocores_i2c_platform_data* pdata;
+	struct ocores_i2c *i2c;
+	struct ocores_i2c_platform_data *pdata;
 	struct resource *res, *res2;
 	int ret;
 
@@ -257,8 +243,7 @@ static int __devinit ocores_i2c_probe(st
 	}
 
 	i2c->base = ioremap(res->start, res->end - res->start + 1);
-	if (!i2c->base)
-	{
+	if (!i2c->base) {
 		dev_err(&pdev->dev, "Unable to map registers\n");
 		ret = -EIO;
 		goto map_failed;
@@ -268,10 +253,8 @@ static int __devinit ocores_i2c_probe(st
 	ocores_init(i2c, pdata);
 
 	init_waitqueue_head(&i2c->wait);
-	ret = request_irq(res2->start, ocores_isr, 0,
-			  pdev->name, i2c);
-	if (ret)
-	{
+	ret = request_irq(res2->start, ocores_isr, 0, pdev->name, i2c);
+	if (ret) {
 		dev_err(&pdev->dev, "Cannot claim IRQ\n");
 		goto request_irq_failed;
 	}
@@ -284,8 +267,7 @@ static int __devinit ocores_i2c_probe(st
 
 	/* add i2c adapter to i2c tree */
 	ret = i2c_add_adapter(&i2c->adap);
-	if (ret)
-	{
+	if (ret) {
 		dev_err(&pdev->dev, "Failed to add adapter\n");
 		goto add_adapter_failed;
 	}
diff -puN drivers/i2c/busses/Kconfig~opencores-i2c-bus-driver-tidy drivers/i2c/busses/Kconfig
diff -puN drivers/i2c/busses/Makefile~opencores-i2c-bus-driver-tidy drivers/i2c/busses/Makefile
diff -puN include/linux/i2c-ocores.h~opencores-i2c-bus-driver-tidy include/linux/i2c-ocores.h
--- 25/include/linux/i2c-ocores.h~opencores-i2c-bus-driver-tidy	Fri Apr 21 14:11:41 2006
+++ 25-akpm/include/linux/i2c-ocores.h	Fri Apr 21 14:11:41 2006
@@ -17,4 +17,3 @@ struct ocores_i2c_platform_data {
 };
 
 #endif /* _LINUX_I2C_OCORES_H */
-
_

Patches currently in -mm which might be from akpm@xxxxxxxx are

origin.patch
config_net=n-build-fix.patch
git-acpi.patch
acpi-update-asus_acpi-driver-registration-fix.patch
acpi-memory-hotplug-cannot-manage-_crs-with-plural-resoureces.patch
catch-notification-of-memory-add-event-of-acpi-via-container-driver-register-start-func-for-memory-device.patch
catch-notification-of-memory-add-event-of-acpi-via-container-driveravoid-redundant-call-add_memory.patch
sony_apci-resume.patch
powernow-k8-crash-workaround.patch
git-dvb.patch
dvb-core-ule-fixes-and-rfc4326-additions-kernel-2616-tidy.patch
sparc32-vivi-fix.patch
git-dvb-compat-build-fix.patch
bt866-build-fix.patch
connector-exports.patch
opencores-i2c-bus-driver-tidy.patch
git-libata-all.patch
git-mtd.patch
pci-error-recovery-e1000-network-device-driver.patch
git-net.patch
powerpc-pseries-avoid-crash-in-pci-code-if-mem-system-not-up-tidy.patch
gregkh-pci-pci-64-bit-resources-drivers-others-changes-amba-fix.patch
git-pcmcia.patch
git-scsi-misc.patch
megaraid-unused-variable.patch
enable-advansys-driver.patch
advansys-warning-workaround.patch
scsi-clean-up-warnings-in-advansys-driver-fix.patch
fix-sco-on-some-bluetooth-adapters-tidy.patch
git-watchdog.patch
arm-add_memory-build-fix.patch
pg_uncached-is-ia64-only.patch
migration-remove-unnecessary-pageswapcache-checks-fix.patch
wait_table-and-zonelist-initializing-for-memory-hotadd-wait_table-initialization-fixes.patch
preserve-write-permissions-in-migration-entries-fix.patch
read-write-migration-entries-make-mprotect-convert-write-migration-fix.patch
read-write-migration-entries-make-mprotect-convert-write-migration-fix-fix.patch
read-write-migration-entries-make-mprotect-convert-write-migration-fix-fix-fix.patch
slab-cleanup-kmem_getpages-fix.patch
slab-stop-using-list_for_each-fix.patch
pgdat-allocation-for-new-node-add-specify-node-id-tidy.patch
pgdat-allocation-for-new-node-add-get-node-id-by-acpi-tidy.patch
pgdat-allocation-for-new-node-add-generic-alloc-node_data-tidy.patch
pgdat-allocation-for-new-node-add-export-kswapd-start-func-tidy.patch
acx1xx-wireless-driver.patch
x86-x86_64-avoid-irq0-ioapic-pin-collision-tidy.patch
prune_one_dentry-tweaks.patch
mmput-might-sleep.patch
jbd-avoid-kfree-null.patch
tpm-use-clear_bit-fix.patch
tpm-use-clear_bit-fix-fix.patch
tpm-use-clear_bit-fix-fix-fix-fix.patch
hangcheck-remove-monotomic_clock-on-x86.patch
pi-futex-futex-code-cleanups-fix.patch
reiser4.patch
kgdb-core-lite-add-reboot-command.patch
kgdb-8250-fix.patch
nr_blockdev_pages-in_interrupt-warning.patch
device-suspend-debug.patch
revert-tty-buffering-comment-out-debug-code.patch
slab-leaks3-default-y.patch
x86-kmap_atomic-debugging.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux