CR SDCaa01608: I2C uses wrong adapter name
authorQuinn Jensen <quinn.jensen@freescale.com>
Thu, 25 Oct 2007 03:20:28 +0000 (21:20 -0600)
committerQuinn Jensen <quinn.jensen@freescale.com>
Thu, 25 Oct 2007 03:20:28 +0000 (21:20 -0600)
Patch for CR SDCaa01608: I2C uses wrong adapter name.
In the mxc_i2c driver, set the adapter name to be the same as the
platform_device name.  Otherwise, drivers that use i2c may fail
when checking the mxc_i2c adapter name, such as the USB driver.
Applies to linux 2.6.22 kernel on MX platforms.

http://www.bitshrine.org/gpp/linux-2.6.22-mx-CR-SDCaa01608-I2C-uses-wrong-adapter-name.patch

drivers/i2c/busses/mxc_i2c.c

index 4d8398d1c6b6c019343e13849b6d9c5601c8d25f..ea9fc2909b09f1b40055985f76f0daf9701cbbc8 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/clk.h>
 #include <asm/irq.h>
 #include <asm/io.h>
+#include <asm/arch/mxc_i2c.h>
 #include "mxc_i2c_reg.h"
 
 /*!
@@ -692,7 +693,7 @@ static int mxci2c_probe(struct platform_device *pdev)
        /*
         * Set the adapter information
         */
-       strcpy(mxc_i2c->adap.name, pdev->name);
+       strcpy(mxc_i2c->adap.name, MXC_ADAPTER_NAME);
        mxc_i2c->adap.id = id;
        mxc_i2c->adap.algo = &mxc_i2c_algorithm;
        mxc_i2c->adap.timeout = 1;