]> err.no Git - linux-2.6/blobdiff - drivers/i2c/chips/eeprom.c
Merge branch 'merge-fixes' into devel
[linux-2.6] / drivers / i2c / chips / eeprom.c
index ef8a754db1db7020cdff0cc85d13c05ff824659f..7dee001e5133bc7df391bc187e28ae082b9315d2 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/mutex.h>
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
+static const unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
                                        0x55, 0x56, 0x57, I2C_CLIENT_END };
 
 /* Insmod parameters */
@@ -71,7 +71,6 @@ static struct i2c_driver eeprom_driver = {
        .driver = {
                .name   = "eeprom",
        },
-       .id             = I2C_DRIVERID_EEPROM,
        .attach_adapter = eeprom_attach_adapter,
        .detach_client  = eeprom_detach_client,
 };
@@ -204,12 +203,16 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
                goto exit_kfree;
 
        /* Detect the Vaio nature of EEPROMs.
-          We use the "PCG-" prefix as the signature. */
+          We use the "PCG-" or "VGN-" prefix as the signature. */
        if (address == 0x57) {
-               if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P'
-                && i2c_smbus_read_byte(new_client) == 'C'
-                && i2c_smbus_read_byte(new_client) == 'G'
-                && i2c_smbus_read_byte(new_client) == '-') {
+               char name[4];
+
+               name[0] = i2c_smbus_read_byte_data(new_client, 0x80);
+               name[1] = i2c_smbus_read_byte(new_client);
+               name[2] = i2c_smbus_read_byte(new_client);
+               name[3] = i2c_smbus_read_byte(new_client);
+
+               if (!memcmp(name, "PCG-", 4) || !memcmp(name, "VGN-", 4)) {
                        dev_info(&new_client->dev, "Vaio EEPROM detected, "
                                 "enabling privacy protection\n");
                        data->nature = VAIO;