Commit 521a2590 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

I2C: move the name field back into the i2c_client and i2c_adapter structures.

This is because the name field of struct device is going away, and the name
fields on these i2c structures are useful for people.
parent 59e53847
...@@ -483,9 +483,7 @@ static struct i2c_adapter ali1535_adapter = { ...@@ -483,9 +483,7 @@ static struct i2c_adapter ali1535_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI1535, .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI1535,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.dev = {
.name = "unset", .name = "unset",
}
}; };
static struct pci_device_id ali1535_ids[] = { static struct pci_device_id ali1535_ids[] = {
...@@ -509,7 +507,7 @@ static int __devinit ali1535_probe(struct pci_dev *dev, const struct pci_device_ ...@@ -509,7 +507,7 @@ static int __devinit ali1535_probe(struct pci_dev *dev, const struct pci_device_
/* set up the driverfs linkage to our parent device */ /* set up the driverfs linkage to our parent device */
ali1535_adapter.dev.parent = &dev->dev; ali1535_adapter.dev.parent = &dev->dev;
snprintf(ali1535_adapter.dev.name, DEVICE_NAME_SIZE, snprintf(ali1535_adapter.name, DEVICE_NAME_SIZE,
"SMBus ALI1535 adapter at %04x", ali1535_smba); "SMBus ALI1535 adapter at %04x", ali1535_smba);
return i2c_add_adapter(&ali1535_adapter); return i2c_add_adapter(&ali1535_adapter);
} }
......
...@@ -474,9 +474,7 @@ static struct i2c_adapter ali15x3_adapter = { ...@@ -474,9 +474,7 @@ static struct i2c_adapter ali15x3_adapter = {
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI15X3, .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI15X3,
.class = I2C_ADAP_CLASS_SMBUS, .class = I2C_ADAP_CLASS_SMBUS,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.dev = {
.name = "unset", .name = "unset",
},
}; };
static struct pci_device_id ali15x3_ids[] = { static struct pci_device_id ali15x3_ids[] = {
...@@ -500,7 +498,7 @@ static int __devinit ali15x3_probe(struct pci_dev *dev, const struct pci_device_ ...@@ -500,7 +498,7 @@ static int __devinit ali15x3_probe(struct pci_dev *dev, const struct pci_device_
/* set up the driverfs linkage to our parent device */ /* set up the driverfs linkage to our parent device */
ali15x3_adapter.dev.parent = &dev->dev; ali15x3_adapter.dev.parent = &dev->dev;
snprintf(ali15x3_adapter.dev.name, DEVICE_NAME_SIZE, snprintf(ali15x3_adapter.name, DEVICE_NAME_SIZE,
"SMBus ALI15X3 adapter at %04x", ali15x3_smba); "SMBus ALI15X3 adapter at %04x", ali15x3_smba);
return i2c_add_adapter(&ali15x3_adapter); return i2c_add_adapter(&ali15x3_adapter);
} }
......
...@@ -307,9 +307,7 @@ static struct i2c_adapter amd756_adapter = { ...@@ -307,9 +307,7 @@ static struct i2c_adapter amd756_adapter = {
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD756, .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD756,
.class = I2C_ADAP_CLASS_SMBUS, .class = I2C_ADAP_CLASS_SMBUS,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.dev = {
.name = "unset", .name = "unset",
},
}; };
enum chiptype { AMD756, AMD766, AMD768, NFORCE }; enum chiptype { AMD756, AMD766, AMD768, NFORCE };
...@@ -371,7 +369,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev, ...@@ -371,7 +369,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev,
/* set up the driverfs linkage to our parent device */ /* set up the driverfs linkage to our parent device */
amd756_adapter.dev.parent = &pdev->dev; amd756_adapter.dev.parent = &pdev->dev;
snprintf(amd756_adapter.dev.name, DEVICE_NAME_SIZE, snprintf(amd756_adapter.name, DEVICE_NAME_SIZE,
"SMBus AMD75x adapter at %04x", amd756_ioport); "SMBus AMD75x adapter at %04x", amd756_ioport);
error = i2c_add_adapter(&amd756_adapter); error = i2c_add_adapter(&amd756_adapter);
......
...@@ -356,7 +356,7 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_ ...@@ -356,7 +356,7 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_
goto out_kfree; goto out_kfree;
smbus->adapter.owner = THIS_MODULE; smbus->adapter.owner = THIS_MODULE;
snprintf(smbus->adapter.dev.name, DEVICE_NAME_SIZE, snprintf(smbus->adapter.name, DEVICE_NAME_SIZE,
"SMBus2 AMD8111 adapter at %04x", smbus->base); "SMBus2 AMD8111 adapter at %04x", smbus->base);
smbus->adapter.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD8111; smbus->adapter.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD8111;
smbus->adapter.class = I2C_ADAP_CLASS_SMBUS; smbus->adapter.class = I2C_ADAP_CLASS_SMBUS;
......
...@@ -543,9 +543,7 @@ static struct i2c_adapter i801_adapter = { ...@@ -543,9 +543,7 @@ static struct i2c_adapter i801_adapter = {
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_I801, .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_I801,
.class = I2C_ADAP_CLASS_SMBUS, .class = I2C_ADAP_CLASS_SMBUS,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.dev = {
.name = "unset", .name = "unset",
},
}; };
static struct pci_device_id i801_ids[] = { static struct pci_device_id i801_ids[] = {
...@@ -600,7 +598,7 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id ...@@ -600,7 +598,7 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id
/* set up the driverfs linkage to our parent device */ /* set up the driverfs linkage to our parent device */
i801_adapter.dev.parent = &dev->dev; i801_adapter.dev.parent = &dev->dev;
snprintf(i801_adapter.dev.name, DEVICE_NAME_SIZE, snprintf(i801_adapter.name, DEVICE_NAME_SIZE,
"SMBus I801 adapter at %04x", i801_smba); "SMBus I801 adapter at %04x", i801_smba);
return i2c_add_adapter(&i801_adapter); return i2c_add_adapter(&i801_adapter);
} }
......
...@@ -42,9 +42,7 @@ static struct i2c_adapter isa_adapter = { ...@@ -42,9 +42,7 @@ static struct i2c_adapter isa_adapter = {
.id = I2C_ALGO_ISA | I2C_HW_ISA, .id = I2C_ALGO_ISA | I2C_HW_ISA,
.class = I2C_ADAP_CLASS_SMBUS, .class = I2C_ADAP_CLASS_SMBUS,
.algo = &isa_algorithm, .algo = &isa_algorithm,
.dev = {
.name = "ISA main adapter", .name = "ISA main adapter",
},
}; };
static int __init i2c_isa_init(void) static int __init i2c_isa_init(void)
......
...@@ -125,9 +125,7 @@ static struct i2c_adapter nforce2_adapter = { ...@@ -125,9 +125,7 @@ static struct i2c_adapter nforce2_adapter = {
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_NFORCE2, .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_NFORCE2,
.class = I2C_ADAP_CLASS_SMBUS, .class = I2C_ADAP_CLASS_SMBUS,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.dev = {
.name = "unset", .name = "unset",
},
}; };
...@@ -342,7 +340,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int reg, ...@@ -342,7 +340,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int reg,
*/ */
smbus->adapter = nforce2_adapter; smbus->adapter = nforce2_adapter;
smbus->adapter.dev.parent = &dev->dev; smbus->adapter.dev.parent = &dev->dev;
snprintf(smbus->adapter.dev.name, DEVICE_NAME_SIZE, snprintf(smbus->adapter.name, DEVICE_NAME_SIZE,
"SMBus nForce2 adapter at %04x", smbus->base); "SMBus nForce2 adapter at %04x", smbus->base);
error = i2c_add_adapter(&smbus->adapter); error = i2c_add_adapter(&smbus->adapter);
......
...@@ -127,7 +127,7 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id ...@@ -127,7 +127,7 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id
if (PCI_FUNC(PIIX4_dev->devfn) != id->driver_data) if (PCI_FUNC(PIIX4_dev->devfn) != id->driver_data)
return -ENODEV; return -ENODEV;
dev_info(&PIIX4_dev->dev, "Found %s device\n", PIIX4_dev->dev.name); dev_info(&PIIX4_dev->dev, "Found %s device\n", pci_name(PIIX4_dev));
if(ibm_dmi_probe()) { if(ibm_dmi_probe()) {
dev_err(&PIIX4_dev->dev, "IBM Laptop detected; this module " dev_err(&PIIX4_dev->dev, "IBM Laptop detected; this module "
...@@ -389,9 +389,7 @@ static struct i2c_adapter piix4_adapter = { ...@@ -389,9 +389,7 @@ static struct i2c_adapter piix4_adapter = {
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_PIIX4, .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_PIIX4,
.class = I2C_ADAP_CLASS_SMBUS, .class = I2C_ADAP_CLASS_SMBUS,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.dev = {
.name = "unset", .name = "unset",
},
}; };
static struct pci_device_id piix4_ids[] = { static struct pci_device_id piix4_ids[] = {
...@@ -444,7 +442,7 @@ static int __devinit piix4_probe(struct pci_dev *dev, const struct pci_device_id ...@@ -444,7 +442,7 @@ static int __devinit piix4_probe(struct pci_dev *dev, const struct pci_device_id
/* set up the driverfs linkage to our parent device */ /* set up the driverfs linkage to our parent device */
piix4_adapter.dev.parent = &dev->dev; piix4_adapter.dev.parent = &dev->dev;
snprintf(piix4_adapter.dev.name, DEVICE_NAME_SIZE, snprintf(piix4_adapter.name, DEVICE_NAME_SIZE,
"SMBus PIIX4 adapter at %04x", piix4_smba); "SMBus PIIX4 adapter at %04x", piix4_smba);
retval = i2c_add_adapter(&piix4_adapter); retval = i2c_add_adapter(&piix4_adapter);
......
...@@ -264,9 +264,7 @@ static struct i2c_adapter sis96x_adapter = { ...@@ -264,9 +264,7 @@ static struct i2c_adapter sis96x_adapter = {
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_SIS96X, .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_SIS96X,
.class = I2C_ADAP_CLASS_SMBUS, .class = I2C_ADAP_CLASS_SMBUS,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.dev = { .name = "unset",
.name ="unset",
},
}; };
static struct pci_device_id sis96x_ids[] = { static struct pci_device_id sis96x_ids[] = {
...@@ -320,7 +318,7 @@ static int __devinit sis96x_probe(struct pci_dev *dev, ...@@ -320,7 +318,7 @@ static int __devinit sis96x_probe(struct pci_dev *dev,
/* set up the driverfs linkage to our parent device */ /* set up the driverfs linkage to our parent device */
sis96x_adapter.dev.parent = &dev->dev; sis96x_adapter.dev.parent = &dev->dev;
snprintf(sis96x_adapter.dev.name, DEVICE_NAME_SIZE, snprintf(sis96x_adapter.name, DEVICE_NAME_SIZE,
"SiS96x SMBus adapter at 0x%04x", sis96x_smbus_base); "SiS96x SMBus adapter at 0x%04x", sis96x_smbus_base);
if ((retval = i2c_add_adapter(&sis96x_adapter))) { if ((retval = i2c_add_adapter(&sis96x_adapter))) {
......
...@@ -290,9 +290,7 @@ static struct i2c_adapter vt596_adapter = { ...@@ -290,9 +290,7 @@ static struct i2c_adapter vt596_adapter = {
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_VIA2, .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_VIA2,
.class = I2C_ADAP_CLASS_SMBUS, .class = I2C_ADAP_CLASS_SMBUS,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.dev = {
.name = "unset", .name = "unset",
},
}; };
static int __devinit vt596_probe(struct pci_dev *pdev, static int __devinit vt596_probe(struct pci_dev *pdev,
...@@ -378,7 +376,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev, ...@@ -378,7 +376,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev,
dev_dbg(&pdev->dev, "VT596_smba = 0x%X\n", vt596_smba); dev_dbg(&pdev->dev, "VT596_smba = 0x%X\n", vt596_smba);
vt596_adapter.dev.parent = &pdev->dev; vt596_adapter.dev.parent = &pdev->dev;
snprintf(vt596_adapter.dev.name, DEVICE_NAME_SIZE, snprintf(vt596_adapter.name, DEVICE_NAME_SIZE,
"SMBus Via Pro adapter at %04x", vt596_smba); "SMBus Via Pro adapter at %04x", vt596_smba);
return i2c_add_adapter(&vt596_adapter); return i2c_add_adapter(&vt596_adapter);
......
...@@ -320,7 +320,7 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -320,7 +320,7 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind)
} }
/* Fill in the remaining client fields and put it into the global list */ /* Fill in the remaining client fields and put it into the global list */
strlcpy(new_client->dev.name, client_name, DEVICE_NAME_SIZE); strlcpy(new_client->name, client_name, DEVICE_NAME_SIZE);
data->type = kind; data->type = kind;
new_client->id = adm1021_id++; new_client->id = adm1021_id++;
......
...@@ -692,7 +692,7 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -692,7 +692,7 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind)
} }
/* Fill in the remaining client fields and put it into the global list */ /* Fill in the remaining client fields and put it into the global list */
strlcpy(new_client->dev.name, name, DEVICE_NAME_SIZE); strlcpy(new_client->name, name, DEVICE_NAME_SIZE);
data->type = kind; data->type = kind;
......
...@@ -194,7 +194,7 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -194,7 +194,7 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
} }
/* Fill in the remaining client fields and put it into the global list */ /* Fill in the remaining client fields and put it into the global list */
strlcpy(new_client->dev.name, name, DEVICE_NAME_SIZE); strlcpy(new_client->name, name, DEVICE_NAME_SIZE);
new_client->id = lm75_id++; new_client->id = lm75_id++;
data->valid = 0; data->valid = 0;
......
...@@ -638,7 +638,7 @@ int lm78_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -638,7 +638,7 @@ int lm78_detect(struct i2c_adapter *adapter, int address, int kind)
} }
/* Fill in the remaining client fields and put into the global list */ /* Fill in the remaining client fields and put into the global list */
strlcpy(new_client->dev.name, client_name, DEVICE_NAME_SIZE); strlcpy(new_client->name, client_name, DEVICE_NAME_SIZE);
data->type = kind; data->type = kind;
data->valid = 0; data->valid = 0;
......
...@@ -853,19 +853,19 @@ int lm85_detect(struct i2c_adapter *adapter, int address, ...@@ -853,19 +853,19 @@ int lm85_detect(struct i2c_adapter *adapter, int address,
/* Fill in the chip specific driver values */ /* Fill in the chip specific driver values */
if ( kind == any_chip ) { if ( kind == any_chip ) {
type_name = "lm85"; type_name = "lm85";
strlcpy(new_client->dev.name, "Generic LM85", DEVICE_NAME_SIZE); strlcpy(new_client->name, "Generic LM85", DEVICE_NAME_SIZE);
} else if ( kind == lm85b ) { } else if ( kind == lm85b ) {
type_name = "lm85b"; type_name = "lm85b";
strlcpy(new_client->dev.name, "National LM85-B", DEVICE_NAME_SIZE); strlcpy(new_client->name, "National LM85-B", DEVICE_NAME_SIZE);
} else if ( kind == lm85c ) { } else if ( kind == lm85c ) {
type_name = "lm85c"; type_name = "lm85c";
strlcpy(new_client->dev.name, "National LM85-C", DEVICE_NAME_SIZE); strlcpy(new_client->name, "National LM85-C", DEVICE_NAME_SIZE);
} else if ( kind == adm1027 ) { } else if ( kind == adm1027 ) {
type_name = "adm1027"; type_name = "adm1027";
strlcpy(new_client->dev.name, "Analog Devices ADM1027", DEVICE_NAME_SIZE); strlcpy(new_client->name, "Analog Devices ADM1027", DEVICE_NAME_SIZE);
} else if ( kind == adt7463 ) { } else if ( kind == adt7463 ) {
type_name = "adt7463"; type_name = "adt7463";
strlcpy(new_client->dev.name, "Analog Devices ADT7463", DEVICE_NAME_SIZE); strlcpy(new_client->name, "Analog Devices ADT7463", DEVICE_NAME_SIZE);
} else { } else {
dev_dbg(&adapter->dev, "Internal error, invalid kind (%d)!", kind); dev_dbg(&adapter->dev, "Internal error, invalid kind (%d)!", kind);
err = -EFAULT ; err = -EFAULT ;
...@@ -880,7 +880,7 @@ int lm85_detect(struct i2c_adapter *adapter, int address, ...@@ -880,7 +880,7 @@ int lm85_detect(struct i2c_adapter *adapter, int address,
if (lm85debug) { if (lm85debug) {
printk("lm85: Assigning ID %d to %s at %d,0x%02x\n", printk("lm85: Assigning ID %d to %s at %d,0x%02x\n",
new_client->id, new_client->dev.name, new_client->id, new_client->name,
i2c_adapter_id(new_client->adapter), i2c_adapter_id(new_client->adapter),
new_client->addr); new_client->addr);
} }
......
...@@ -727,7 +727,7 @@ static int via686a_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -727,7 +727,7 @@ static int via686a_detect(struct i2c_adapter *adapter, int address, int kind)
new_client->dev.parent = &adapter->dev; new_client->dev.parent = &adapter->dev;
/* Fill in the remaining client fields and put into the global list */ /* Fill in the remaining client fields and put into the global list */
snprintf(new_client->dev.name, DEVICE_NAME_SIZE, client_name); snprintf(new_client->name, DEVICE_NAME_SIZE, client_name);
data->valid = 0; data->valid = 0;
init_MUTEX(&data->update_lock); init_MUTEX(&data->update_lock);
......
...@@ -1116,7 +1116,7 @@ w83781d_detect_subclients(struct i2c_adapter *adapter, int address, int kind, ...@@ -1116,7 +1116,7 @@ w83781d_detect_subclients(struct i2c_adapter *adapter, int address, int kind,
data->lm75[i]->adapter = adapter; data->lm75[i]->adapter = adapter;
data->lm75[i]->driver = &w83781d_driver; data->lm75[i]->driver = &w83781d_driver;
data->lm75[i]->flags = 0; data->lm75[i]->flags = 0;
strlcpy(data->lm75[i]->dev.name, client_name, strlcpy(data->lm75[i]->name, client_name,
DEVICE_NAME_SIZE); DEVICE_NAME_SIZE);
if ((err = i2c_attach_client(data->lm75[i]))) { if ((err = i2c_attach_client(data->lm75[i]))) {
dev_err(&new_client->dev, "Subclient %d " dev_err(&new_client->dev, "Subclient %d "
...@@ -1326,7 +1326,7 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -1326,7 +1326,7 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
} }
/* Fill in the remaining client fields and put into the global list */ /* Fill in the remaining client fields and put into the global list */
strlcpy(new_client->dev.name, client_name, DEVICE_NAME_SIZE); strlcpy(new_client->name, client_name, DEVICE_NAME_SIZE);
data->type = kind; data->type = kind;
data->valid = 0; data->valid = 0;
......
...@@ -527,7 +527,7 @@ int i2c_bit_add_bus(struct i2c_adapter *adap) ...@@ -527,7 +527,7 @@ int i2c_bit_add_bus(struct i2c_adapter *adap)
struct i2c_algo_bit_data *bit_adap = adap->algo_data; struct i2c_algo_bit_data *bit_adap = adap->algo_data;
if (bit_test) { if (bit_test) {
int ret = test_bus(bit_adap, adap->dev.name); int ret = test_bus(bit_adap, adap->name);
if (ret<0) if (ret<0)
return -ENODEV; return -ENODEV;
} }
......
...@@ -250,7 +250,7 @@ int i2c_del_driver(struct i2c_driver *driver) ...@@ -250,7 +250,7 @@ int i2c_del_driver(struct i2c_driver *driver)
continue; continue;
DEB2(printk(KERN_DEBUG "i2c-core.o: " DEB2(printk(KERN_DEBUG "i2c-core.o: "
"detaching client %s:\n", "detaching client %s:\n",
client->dev.name)); client->name));
if ((res = driver->detach_client(client))) { if ((res = driver->detach_client(client))) {
dev_err(&adap->dev, "while " dev_err(&adap->dev, "while "
"unregistering driver " "unregistering driver "
...@@ -352,7 +352,7 @@ int i2c_detach_client(struct i2c_client *client) ...@@ -352,7 +352,7 @@ int i2c_detach_client(struct i2c_client *client)
if (res) { if (res) {
printk(KERN_ERR printk(KERN_ERR
"i2c-core.o: client_unregister [%s] failed, " "i2c-core.o: client_unregister [%s] failed, "
"client not detached", client->dev.name); "client not detached", client->name);
goto out; goto out;
} }
} }
......
...@@ -484,9 +484,7 @@ static struct i2c_driver i2cdev_driver = { ...@@ -484,9 +484,7 @@ static struct i2c_driver i2cdev_driver = {
}; };
static struct i2c_client i2cdev_client_template = { static struct i2c_client i2cdev_client_template = {
.dev = {
.name = "I2C /dev entry", .name = "I2C /dev entry",
},
.id = 1, .id = 1,
.addr = -1, .addr = -1,
.driver = &i2cdev_driver, .driver = &i2cdev_driver,
......
...@@ -178,9 +178,7 @@ static struct i2c_adapter pcf_isa_ops = { ...@@ -178,9 +178,7 @@ static struct i2c_adapter pcf_isa_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.id = I2C_HW_P_ELEK, .id = I2C_HW_P_ELEK,
.algo_data = &pcf_isa_data, .algo_data = &pcf_isa_data,
.dev = {
.name = "PCF8584 ISA adapter", .name = "PCF8584 ISA adapter",
},
}; };
static int __init i2c_pcfisa_init(void) static int __init i2c_pcfisa_init(void)
......
...@@ -131,9 +131,7 @@ static struct i2c_adapter bit_elv_ops = { ...@@ -131,9 +131,7 @@ static struct i2c_adapter bit_elv_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.id = I2C_HW_B_ELV, .id = I2C_HW_B_ELV,
.algo_data = &bit_elv_data, .algo_data = &bit_elv_data,
.dev = {
.name = "ELV Parallel port adaptor", .name = "ELV Parallel port adaptor",
},
}; };
static int __init i2c_bitelv_init(void) static int __init i2c_bitelv_init(void)
......
...@@ -152,9 +152,7 @@ static struct i2c_algo_bit_data bit_lp_data2 = { ...@@ -152,9 +152,7 @@ static struct i2c_algo_bit_data bit_lp_data2 = {
static struct i2c_adapter bit_lp_ops = { static struct i2c_adapter bit_lp_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.id = I2C_HW_B_LP, .id = I2C_HW_B_LP,
.dev = {
.name = "Philips Parallel port adapter", .name = "Philips Parallel port adapter",
},
}; };
static void i2c_parport_attach (struct parport *port) static void i2c_parport_attach (struct parport *port)
......
...@@ -70,12 +70,7 @@ ...@@ -70,12 +70,7 @@
#define DRIVER_ID "i2c-prosavage" #define DRIVER_ID "i2c-prosavage"
#define DRIVER_VERSION "20030621" #define DRIVER_VERSION "20030621"
/* lm_sensors2 / kernel 2.5.xx compatibility */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#define ADAPTER_NAME(x) (x).name #define ADAPTER_NAME(x) (x).name
#else
#define ADAPTER_NAME(x) (x).dev.name
#endif /* LINUX_VERSION_CODE */
#define MAX_BUSSES 2 #define MAX_BUSSES 2
......
...@@ -116,9 +116,7 @@ static struct i2c_adapter bit_velle_ops = { ...@@ -116,9 +116,7 @@ static struct i2c_adapter bit_velle_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.id = I2C_HW_B_VELLE, .id = I2C_HW_B_VELLE,
.algo_data = &bit_velle_data, .algo_data = &bit_velle_data,
.dev = {
.name = "Velleman K8000", .name = "Velleman K8000",
},
}; };
static int __init i2c_bitvelle_init(void) static int __init i2c_bitvelle_init(void)
......
...@@ -456,14 +456,14 @@ static int __init scx200_acb_create(int base, int index) ...@@ -456,14 +456,14 @@ static int __init scx200_acb_create(int base, int index)
memset(iface, 0, sizeof(*iface)); memset(iface, 0, sizeof(*iface));
adapter = &iface->adapter; adapter = &iface->adapter;
i2c_set_adapdata(adapter, iface); i2c_set_adapdata(adapter, iface);
snprintf(adapter->dev.name, DEVICE_NAME_SIZE, "SCx200 ACB%d", index); snprintf(adapter->name, DEVICE_NAME_SIZE, "SCx200 ACB%d", index);
adapter->owner = THIS_MODULE; adapter->owner = THIS_MODULE;
adapter->id = I2C_ALGO_SMBUS; adapter->id = I2C_ALGO_SMBUS;
adapter->algo = &scx200_acb_algorithm; adapter->algo = &scx200_acb_algorithm;
init_MUTEX(&iface->sem); init_MUTEX(&iface->sem);
snprintf(description, sizeof(description), "NatSemi SCx200 ACCESS.bus [%s]", adapter->dev.name); snprintf(description, sizeof(description), "NatSemi SCx200 ACCESS.bus [%s]", adapter->name);
if (request_region(base, 8, description) == 0) { if (request_region(base, 8, description) == 0) {
dev_err(&adapter->dev, "can't allocate io 0x%x-0x%x\n", dev_err(&adapter->dev, "can't allocate io 0x%x-0x%x\n",
base, base + 8-1); base, base + 8-1);
......
...@@ -407,11 +407,10 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c ...@@ -407,11 +407,10 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c
if( NULL != i2c_adapter ) { if( NULL != i2c_adapter ) {
memset(i2c_adapter,0,sizeof(struct i2c_adapter)); memset(i2c_adapter,0,sizeof(struct i2c_adapter));
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
strcpy(i2c_adapter->name, dev->name); strcpy(i2c_adapter->name, dev->name);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
i2c_adapter->data = dev; i2c_adapter->data = dev;
#else #else
strcpy(i2c_adapter->dev.name, dev->name);
i2c_set_adapdata(i2c_adapter,dev); i2c_set_adapdata(i2c_adapter,dev);
#endif #endif
i2c_adapter->algo = &saa7146_algo; i2c_adapter->algo = &saa7146_algo;
......
...@@ -159,7 +159,7 @@ static const unsigned char init_ntsc[] = { ...@@ -159,7 +159,7 @@ static const unsigned char init_ntsc[] = {
0x06, 0x1a, /* subc. phase */ 0x06, 0x1a, /* subc. phase */
}; };
static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind) static int adv717x_attach(struct i2c_adapter *adap, int addr, int kind)
{ {
struct adv7175 *encoder; struct adv7175 *encoder;
struct i2c_client *client; struct i2c_client *client;
...@@ -191,7 +191,7 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla ...@@ -191,7 +191,7 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla
// We should never get here!!! // We should never get here!!!
dname = unknown_name; dname = unknown_name;
} }
strlcpy(client->dev.name, dname, DEVICE_NAME_SIZE); strlcpy(client->name, dname, DEVICE_NAME_SIZE);
init_MUTEX(&encoder->lock); init_MUTEX(&encoder->lock);
encoder->client = client; encoder->client = client;
i2c_set_clientdata(client, encoder); i2c_set_clientdata(client, encoder);
...@@ -203,7 +203,7 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla ...@@ -203,7 +203,7 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla
for (i=1; i<x_common; i++) { for (i=1; i<x_common; i++) {
rv = i2c_smbus_write_byte(client,init_common[i]); rv = i2c_smbus_write_byte(client,init_common[i]);
if (rv < 0) { if (rv < 0) {
printk(KERN_ERR "%s_attach: init error %d\n", client->dev.name, rv); printk(KERN_ERR "%s_attach: init error %d\n", client->name, rv);
break; break;
} }
} }
...@@ -213,7 +213,7 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla ...@@ -213,7 +213,7 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla
i2c_smbus_write_byte_data(client,0x07, TR0MODE); i2c_smbus_write_byte_data(client,0x07, TR0MODE);
i2c_smbus_read_byte_data(client,0x12); i2c_smbus_read_byte_data(client,0x12);
printk(KERN_INFO "%s_attach: %s rev. %d at 0x%02x\n", printk(KERN_INFO "%s_attach: %s rev. %d at 0x%02x\n",
client->dev.name, dname, rv & 1, client->addr); client->name, dname, rv & 1, client->addr);
} }
i2c_attach_client(client); i2c_attach_client(client);
...@@ -297,9 +297,8 @@ static int adv717x_command(struct i2c_client *client, unsigned int cmd, ...@@ -297,9 +297,8 @@ static int adv717x_command(struct i2c_client *client, unsigned int cmd,
i2c_smbus_write_byte_data(client,0x07, TR0MODE); i2c_smbus_write_byte_data(client,0x07, TR0MODE);
break; break;
default: default:
printk(KERN_ERR printk(KERN_ERR "%s: illegal norm: %d\n",
"%s: illegal norm: %d\n", client->name, iarg);
client->dev.name, iarg);
return -EINVAL; return -EINVAL;
} }
...@@ -353,9 +352,8 @@ static int adv717x_command(struct i2c_client *client, unsigned int cmd, ...@@ -353,9 +352,8 @@ static int adv717x_command(struct i2c_client *client, unsigned int cmd,
break; break;
default: default:
printk(KERN_ERR printk(KERN_ERR "%s: illegal input: %d\n",
"%s: illegal input: %d\n", client->name, iarg);
client->dev.name, iarg);
return -EINVAL; return -EINVAL;
} }
...@@ -422,9 +420,7 @@ static struct i2c_driver i2c_driver_adv7176 = { ...@@ -422,9 +420,7 @@ static struct i2c_driver i2c_driver_adv7176 = {
static struct i2c_client client_template = { static struct i2c_client client_template = {
.driver = &i2c_driver_adv7175, .driver = &i2c_driver_adv7175,
.dev = {
.name = "adv7175_client", .name = "adv7175_client",
},
}; };
static int adv717x_init(void) static int adv717x_init(void)
......
...@@ -150,7 +150,7 @@ static int bt819_init(struct i2c_client *client) ...@@ -150,7 +150,7 @@ static int bt819_init(struct i2c_client *client)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static int bt819_attach(struct i2c_adapter *adap, int addr , unsigned long flags, int kind) static int bt819_attach(struct i2c_adapter *adap, int addr, int kind)
{ {
int i; int i;
struct bt819 *decoder; struct bt819 *decoder;
...@@ -172,7 +172,7 @@ static int bt819_attach(struct i2c_adapter *adap, int addr , unsigned long flags ...@@ -172,7 +172,7 @@ static int bt819_attach(struct i2c_adapter *adap, int addr , unsigned long flags
} }
memset(decoder, 0, sizeof(struct bt819)); memset(decoder, 0, sizeof(struct bt819));
strlcpy(client->dev.name, "bt819", DEVICE_NAME_SIZE); strlcpy(client->name, "bt819", DEVICE_NAME_SIZE);
i2c_set_clientdata(client, decoder); i2c_set_clientdata(client, decoder);
decoder->client = client; decoder->client = client;
decoder->addr = addr; decoder->addr = addr;
...@@ -188,10 +188,10 @@ static int bt819_attach(struct i2c_adapter *adap, int addr , unsigned long flags ...@@ -188,10 +188,10 @@ static int bt819_attach(struct i2c_adapter *adap, int addr , unsigned long flags
i = bt819_init(client); i = bt819_init(client);
if (i < 0) { if (i < 0) {
printk(KERN_ERR "%s: bt819_attach: init status %d\n", printk(KERN_ERR "%s: bt819_attach: init status %d\n",
decoder->client->dev.name, i); decoder->client->name, i);
} else { } else {
printk(KERN_INFO "%s: bt819_attach: chip version %x\n", printk(KERN_INFO "%s: bt819_attach: chip version %x\n",
decoder->client->dev.name, i2c_smbus_read_byte_data(client, decoder->client->name, i2c_smbus_read_byte_data(client,
0x17) & 0x0f); 0x17) & 0x0f);
} }
init_MUTEX(&decoder->lock); init_MUTEX(&decoder->lock);
...@@ -270,7 +270,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -270,7 +270,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg)
*iarg = res; *iarg = res;
DEBUG(printk(KERN_INFO "%s-bt819: get status %x\n", DEBUG(printk(KERN_INFO "%s-bt819: get status %x\n",
decoder->client->dev.name, *iarg)); decoder->client->name, *iarg));
} }
break; break;
...@@ -280,7 +280,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -280,7 +280,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg)
struct timing *timing; struct timing *timing;
DEBUG(printk(KERN_INFO "%s-bt819: set norm %x\n", DEBUG(printk(KERN_INFO "%s-bt819: set norm %x\n",
decoder->client->dev.name, *iarg)); decoder->client->name, *iarg));
if (*iarg == VIDEO_MODE_NTSC) { if (*iarg == VIDEO_MODE_NTSC) {
bt819_setbit(decoder, 0x01, 0, 1); bt819_setbit(decoder, 0x01, 0, 1);
...@@ -321,7 +321,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -321,7 +321,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg)
int *iarg = arg; int *iarg = arg;
DEBUG(printk(KERN_INFO "%s-bt819: set input %x\n", DEBUG(printk(KERN_INFO "%s-bt819: set input %x\n",
decoder->client->dev.name, *iarg)); decoder->client->name, *iarg));
if (*iarg < 0 || *iarg > 7) { if (*iarg < 0 || *iarg > 7) {
return -EINVAL; return -EINVAL;
...@@ -346,7 +346,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -346,7 +346,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg)
int *iarg = arg; int *iarg = arg;
DEBUG(printk(KERN_INFO "%s-bt819: set output %x\n", DEBUG(printk(KERN_INFO "%s-bt819: set output %x\n",
decoder->client->dev.name, *iarg)); decoder->client->name, *iarg));
/* not much choice of outputs */ /* not much choice of outputs */
if (*iarg != 0) { if (*iarg != 0) {
...@@ -362,7 +362,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -362,7 +362,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg)
DEBUG(printk DEBUG(printk
(KERN_INFO "%s-bt819: enable output %x\n", (KERN_INFO "%s-bt819: enable output %x\n",
decoder->client->dev.name, *iarg)); decoder->client->name, *iarg));
if (decoder->enable != enable) { if (decoder->enable != enable) {
decoder->enable = enable; decoder->enable = enable;
...@@ -383,7 +383,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -383,7 +383,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg)
DEBUG(printk DEBUG(printk
(KERN_INFO (KERN_INFO
"%s-bt819: set picture brightness %d contrast %d colour %d\n", "%s-bt819: set picture brightness %d contrast %d colour %d\n",
decoder->client->dev.name, pic->brightness, decoder->client->name, pic->brightness,
pic->contrast, pic->colour)); pic->contrast, pic->colour));
...@@ -452,9 +452,7 @@ static struct i2c_driver i2c_driver_bt819 = { ...@@ -452,9 +452,7 @@ static struct i2c_driver i2c_driver_bt819 = {
static struct i2c_client client_template = { static struct i2c_client client_template = {
.id = -1, .id = -1,
.driver = &i2c_driver_bt819, .driver = &i2c_driver_bt819,
.dev = {
.name = "bt819_client", .name = "bt819_client",
},
}; };
static int bt819_setup(void) static int bt819_setup(void)
......
...@@ -97,7 +97,7 @@ static int bt856_setbit(struct bt856 *dev, int subaddr, int bit, int data) ...@@ -97,7 +97,7 @@ static int bt856_setbit(struct bt856 *dev, int subaddr, int bit, int data)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static int bt856_attach(struct i2c_adapter *adap, int addr , unsigned long flags, int kind) static int bt856_attach(struct i2c_adapter *adap, int addr, int kind)
{ {
struct bt856 *encoder; struct bt856 *encoder;
struct i2c_client *client; struct i2c_client *client;
...@@ -123,14 +123,14 @@ static int bt856_attach(struct i2c_adapter *adap, int addr , unsigned long flags ...@@ -123,14 +123,14 @@ static int bt856_attach(struct i2c_adapter *adap, int addr , unsigned long flags
memset(encoder, 0, sizeof(struct bt856)); memset(encoder, 0, sizeof(struct bt856));
strlcpy(client->dev.name, "bt856", DEVICE_NAME_SIZE); strlcpy(client->name, "bt856", DEVICE_NAME_SIZE);
encoder->client = client; encoder->client = client;
i2c_set_clientdata(client, encoder); i2c_set_clientdata(client, encoder);
encoder->addr = client->addr; encoder->addr = client->addr;
encoder->norm = VIDEO_MODE_NTSC; encoder->norm = VIDEO_MODE_NTSC;
encoder->enable = 1; encoder->enable = 1;
DEBUG(printk(KERN_INFO "%s-bt856: attach\n", encoder->client->dev.name)); DEBUG(printk(KERN_INFO "%s-bt856: attach\n", encoder->client->name));
i2c_smbus_write_byte_data(client, 0xdc, 0x18); i2c_smbus_write_byte_data(client, 0xdc, 0x18);
encoder->reg[0xdc] = 0x18; encoder->reg[0xdc] = 0x18;
...@@ -190,7 +190,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, ...@@ -190,7 +190,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd,
DEBUG(printk DEBUG(printk
(KERN_INFO "%s-bt856: get capabilities\n", (KERN_INFO "%s-bt856: get capabilities\n",
encoder->client->dev.name)); encoder->client->name));
cap->flags cap->flags
= VIDEO_ENCODER_PAL = VIDEO_ENCODER_PAL
...@@ -205,7 +205,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, ...@@ -205,7 +205,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd,
int *iarg = arg; int *iarg = arg;
DEBUG(printk(KERN_INFO "%s-bt856: set norm %d\n", DEBUG(printk(KERN_INFO "%s-bt856: set norm %d\n",
encoder->client->dev.name, *iarg)); encoder->client->name, *iarg));
switch (*iarg) { switch (*iarg) {
...@@ -232,7 +232,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, ...@@ -232,7 +232,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd,
int *iarg = arg; int *iarg = arg;
DEBUG(printk(KERN_INFO "%s-bt856: set input %d\n", DEBUG(printk(KERN_INFO "%s-bt856: set input %d\n",
encoder->client->dev.name, *iarg)); encoder->client->name, *iarg));
/* We only have video bus. /* We only have video bus.
*iarg = 0: input is from bt819 *iarg = 0: input is from bt819
...@@ -268,7 +268,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, ...@@ -268,7 +268,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd,
int *iarg = arg; int *iarg = arg;
DEBUG(printk(KERN_INFO "%s-bt856: set output %d\n", DEBUG(printk(KERN_INFO "%s-bt856: set output %d\n",
encoder->client->dev.name, *iarg)); encoder->client->name, *iarg));
/* not much choice of outputs */ /* not much choice of outputs */
if (*iarg != 0) { if (*iarg != 0) {
...@@ -285,7 +285,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, ...@@ -285,7 +285,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd,
DEBUG(printk DEBUG(printk
(KERN_INFO "%s-bt856: enable output %d\n", (KERN_INFO "%s-bt856: enable output %d\n",
encoder->client->dev.name, encoder->enable)); encoder->client->name, encoder->enable));
} }
break; break;
...@@ -311,9 +311,7 @@ static struct i2c_driver i2c_driver_bt856 = { ...@@ -311,9 +311,7 @@ static struct i2c_driver i2c_driver_bt856 = {
static struct i2c_client client_template = { static struct i2c_client client_template = {
.id = -1, .id = -1,
.driver = &i2c_driver_bt856, .driver = &i2c_driver_bt856,
.dev = {
.name = "bt856_client", .name = "bt856_client",
},
}; };
static int bt856_init(void) static int bt856_init(void)
......
...@@ -3469,7 +3469,7 @@ void __devinit bttv_check_chipset(void) ...@@ -3469,7 +3469,7 @@ void __devinit bttv_check_chipset(void)
/* print which chipset we have */ /* print which chipset we have */
while ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8,dev))) while ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8,dev)))
printk(KERN_INFO "bttv: Host bridge is %s\n",dev->dev.name); printk(KERN_INFO "bttv: Host bridge is %s\n",pci_name(dev));
/* print warnings about any quirks found */ /* print warnings about any quirks found */
if (triton1) if (triton1)
......
...@@ -1316,7 +1316,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -1316,7 +1316,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
#endif #endif
msp3400c_setvolume(c,msp->muted,msp->left,msp->right); msp3400c_setvolume(c,msp->muted,msp->left,msp->right);
snprintf(c->dev.name, DEVICE_NAME_SIZE, "MSP34%02d%c-%c%d", snprintf(c->name, DEVICE_NAME_SIZE, "MSP34%02d%c-%c%d",
(msp->rev2>>8)&0xff, (msp->rev1&0xff)+'@', (msp->rev2>>8)&0xff, (msp->rev1&0xff)+'@',
((msp->rev1>>8)&0xff)+'@', msp->rev2&0x1f); ((msp->rev1>>8)&0xff)+'@', msp->rev2&0x1f);
......
...@@ -171,7 +171,7 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -171,7 +171,7 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
return -ENOMEM; return -ENOMEM;
} }
memset(t, 0, sizeof(*t)); memset(t, 0, sizeof(*t));
strlcpy(client->dev.name, IF_NAME, DEVICE_NAME_SIZE); strlcpy(client->name, IF_NAME, DEVICE_NAME_SIZE);
init_MUTEX(&t->lock); init_MUTEX(&t->lock);
/* /*
...@@ -263,9 +263,7 @@ static struct i2c_driver i2c_driver_videotext = ...@@ -263,9 +263,7 @@ static struct i2c_driver i2c_driver_videotext =
static struct i2c_client client_template = { static struct i2c_client client_template = {
.id = -1, .id = -1,
.driver = &i2c_driver_videotext, .driver = &i2c_driver_videotext,
.dev = {
.name = "(unset)", .name = "(unset)",
},
}; };
/* /*
......
...@@ -147,7 +147,7 @@ int determine_norm(struct i2c_client* client) ...@@ -147,7 +147,7 @@ int determine_norm(struct i2c_client* client)
} }
static static
int saa7110_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind) int saa7110_attach(struct i2c_adapter *adap, int addr, int kind)
{ {
static const unsigned char initseq[] = { static const unsigned char initseq[] = {
0, 0x4C, 0x3C, 0x0D, 0xEF, 0xBD, 0xF0, 0x00, 0x00, 0, 0x4C, 0x3C, 0x0D, 0xEF, 0xBD, 0xF0, 0x00, 0x00,
...@@ -176,7 +176,7 @@ static const unsigned char initseq[] = { ...@@ -176,7 +176,7 @@ static const unsigned char initseq[] = {
/* clear our private data */ /* clear our private data */
memset(decoder, 0, sizeof(*decoder)); memset(decoder, 0, sizeof(*decoder));
strlcpy(client->dev.name, IF_NAME, DEVICE_NAME_SIZE); strlcpy(client->name, IF_NAME, DEVICE_NAME_SIZE);
decoder->client = client; decoder->client = client;
i2c_set_clientdata(client, decoder); i2c_set_clientdata(client, decoder);
decoder->addr = addr; decoder->addr = addr;
...@@ -190,7 +190,7 @@ static const unsigned char initseq[] = { ...@@ -190,7 +190,7 @@ static const unsigned char initseq[] = {
rv = i2c_master_send(client, initseq, sizeof(initseq)); rv = i2c_master_send(client, initseq, sizeof(initseq));
if (rv < 0) if (rv < 0)
printk(KERN_ERR "%s_attach: init status %d\n", client->dev.name, rv); printk(KERN_ERR "%s_attach: init status %d\n", client->name, rv);
else { else {
i2c_smbus_write_byte_data(client,0x21,0x16); i2c_smbus_write_byte_data(client,0x21,0x16);
i2c_smbus_write_byte_data(client,0x0D,0x04); i2c_smbus_write_byte_data(client,0x0D,0x04);
...@@ -393,9 +393,7 @@ static struct i2c_driver i2c_driver_saa7110 = ...@@ -393,9 +393,7 @@ static struct i2c_driver i2c_driver_saa7110 =
static struct i2c_client client_template = { static struct i2c_client client_template = {
.id = -1, .id = -1,
.driver = &i2c_driver_saa7110, .driver = &i2c_driver_saa7110,
.dev = {
.name = "saa7110_client", .name = "saa7110_client",
},
}; };
static int saa7110_init(void) static int saa7110_init(void)
......
...@@ -122,7 +122,7 @@ static int saa7111_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -122,7 +122,7 @@ static int saa7111_attach(struct i2c_adapter *adap, int addr, int kind)
} }
memset(decoder, 0, sizeof(*decoder)); memset(decoder, 0, sizeof(*decoder));
strlcpy(client->dev.name, "saa7111", DEVICE_NAME_SIZE); strlcpy(client->name, "saa7111", DEVICE_NAME_SIZE);
decoder->client = client; decoder->client = client;
i2c_set_clientdata(client, decoder); i2c_set_clientdata(client, decoder);
decoder->addr = addr; decoder->addr = addr;
...@@ -137,10 +137,10 @@ static int saa7111_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -137,10 +137,10 @@ static int saa7111_attach(struct i2c_adapter *adap, int addr, int kind)
i = i2c_master_send(client, init, sizeof(init)); i = i2c_master_send(client, init, sizeof(init));
if (i < 0) { if (i < 0) {
printk(KERN_ERR "%s_attach: init status %d\n", printk(KERN_ERR "%s_attach: init status %d\n",
client->dev.name, i); client->name, i);
} else { } else {
printk(KERN_INFO "%s_attach: chip version %x @ 0x%08x\n", printk(KERN_INFO "%s_attach: chip version %x @ 0x%08x\n",
client->dev.name, i2c_smbus_read_byte_data(client, 0x00) >> 4,addr); client->name, i2c_smbus_read_byte_data(client, 0x00) >> 4,addr);
} }
init_MUTEX(&decoder->lock); init_MUTEX(&decoder->lock);
...@@ -159,7 +159,7 @@ static int saa7111_probe(struct i2c_adapter *adap) ...@@ -159,7 +159,7 @@ static int saa7111_probe(struct i2c_adapter *adap)
} }
printk("saa7111: probing %s i2c adapter [id=0x%x]\n", printk("saa7111: probing %s i2c adapter [id=0x%x]\n",
adap->dev.name,adap->id); adap->name,adap->id);
return i2c_probe(adap, &addr_data, saa7111_attach); return i2c_probe(adap, &addr_data, saa7111_attach);
} }
...@@ -188,8 +188,7 @@ static int saa7111_command(struct i2c_client *client, unsigned int cmd, ...@@ -188,8 +188,7 @@ static int saa7111_command(struct i2c_client *client, unsigned int cmd,
for (i = 0; i < 32; i += 16) { for (i = 0; i < 32; i += 16) {
int j; int j;
printk("KERN_DEBUG %s: %03x", client->dev.name, printk("KERN_DEBUG %s: %03x", client->name, i);
i);
for (j = 0; j < 16; ++j) { for (j = 0; j < 16; ++j) {
printk(" %02x", printk(" %02x",
i2c_smbus_read_byte_data(client, i2c_smbus_read_byte_data(client,
...@@ -413,9 +412,7 @@ static struct i2c_driver i2c_driver_saa7111 = { ...@@ -413,9 +412,7 @@ static struct i2c_driver i2c_driver_saa7111 = {
static struct i2c_client client_template = { static struct i2c_client client_template = {
.id = -1, .id = -1,
.driver = &i2c_driver_saa7111, .driver = &i2c_driver_saa7111,
.dev = {
.name = "saa7111_client", .name = "saa7111_client",
},
}; };
static int saa7111_init(void) static int saa7111_init(void)
......
...@@ -399,7 +399,7 @@ void saa7134_i2c_call_clients(struct saa7134_dev *dev, ...@@ -399,7 +399,7 @@ void saa7134_i2c_call_clients(struct saa7134_dev *dev,
int saa7134_i2c_register(struct saa7134_dev *dev) int saa7134_i2c_register(struct saa7134_dev *dev)
{ {
dev->i2c_adap = saa7134_adap_template; dev->i2c_adap = saa7134_adap_template;
strcpy(dev->i2c_adap.dev.name,dev->name); strcpy(dev->i2c_adap.name,dev->name);
dev->i2c_adap.algo_data = dev; dev->i2c_adap.algo_data = dev;
i2c_add_adapter(&dev->i2c_adap); i2c_add_adapter(&dev->i2c_adap);
......
...@@ -181,7 +181,7 @@ static const unsigned char init_ntsc[] = { ...@@ -181,7 +181,7 @@ static const unsigned char init_ntsc[] = {
0x66, 0x21, /* FSC3 */ 0x66, 0x21, /* FSC3 */
}; };
static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind) static int saa7185_attach(struct i2c_adapter *adap, int addr, int kind)
{ {
int i; int i;
struct saa7185 *encoder; struct saa7185 *encoder;
...@@ -202,7 +202,7 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla ...@@ -202,7 +202,7 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla
memset(encoder, 0, sizeof(*encoder)); memset(encoder, 0, sizeof(*encoder));
strlcpy(client->dev.name, "saa7185", DEVICE_NAME_SIZE); strlcpy(client->name, "saa7185", DEVICE_NAME_SIZE);
encoder->client = client; encoder->client = client;
i2c_set_clientdata(client, encoder); i2c_set_clientdata(client, encoder);
encoder->addr = addr; encoder->addr = addr;
...@@ -215,11 +215,10 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla ...@@ -215,11 +215,10 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla
sizeof(init_ntsc)); sizeof(init_ntsc));
} }
if (i < 0) { if (i < 0) {
printk(KERN_ERR "%s_attach: init error %d\n", client->dev.name, printk(KERN_ERR "%s_attach: init error %d\n", client->name, i);
i);
} else { } else {
printk(KERN_INFO "%s_attach: chip version %d\n", printk(KERN_INFO "%s_attach: chip version %d\n",
client->dev.name, i2c_smbus_read_byte(client) >> 5); client->name, i2c_smbus_read_byte(client) >> 5);
} }
init_MUTEX(&encoder->lock); init_MUTEX(&encoder->lock);
i2c_attach_client(client); i2c_attach_client(client);
...@@ -367,9 +366,7 @@ static struct i2c_driver i2c_driver_saa7185 = { ...@@ -367,9 +366,7 @@ static struct i2c_driver i2c_driver_saa7185 = {
static struct i2c_client client_template = { static struct i2c_client client_template = {
.id = -1, .id = -1,
.driver = &i2c_driver_saa7185, .driver = &i2c_driver_saa7185,
.dev = {
.name = "saa7185_client", .name = "saa7185_client",
},
}; };
static int saa7185_init(void) static int saa7185_init(void)
......
...@@ -198,7 +198,7 @@ static int tda9840_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -198,7 +198,7 @@ static int tda9840_detect(struct i2c_adapter *adapter, int address, int kind)
} }
/* fill client structure */ /* fill client structure */
sprintf(client->dev.name,"tda9840 (0x%02x)", address); sprintf(client->name,"tda9840 (0x%02x)", address);
client->id = tda9840_id++; client->id = tda9840_id++;
client->flags = 0; client->flags = 0;
client->addr = address; client->addr = address;
...@@ -227,7 +227,7 @@ static int tda9840_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -227,7 +227,7 @@ static int tda9840_detect(struct i2c_adapter *adapter, int address, int kind)
printk("tda9840.o: could not initialize ic #3. continuing anyway. (result:%d)\n",result); printk("tda9840.o: could not initialize ic #3. continuing anyway. (result:%d)\n",result);
} }
printk("tda9840.o: detected @ 0x%02x on adapter %s\n",2*address,&client->adapter->dev.name[0]); printk("tda9840.o: detected @ 0x%02x on adapter %s\n",2*address,&client->adapter->name[0]);
return 0; return 0;
} }
...@@ -236,7 +236,7 @@ static int tda9840_attach(struct i2c_adapter *adapter) ...@@ -236,7 +236,7 @@ static int tda9840_attach(struct i2c_adapter *adapter)
{ {
/* let's see whether this is a know adapter we can attach to */ /* let's see whether this is a know adapter we can attach to */
if( adapter->id != I2C_ALGO_SAA7146 ) { if( adapter->id != I2C_ALGO_SAA7146 ) {
dprintk("tda9840.o: refusing to probe on unknown adapter [name='%s',id=0x%x]\n",adapter->dev.name,adapter->id); dprintk("tda9840.o: refusing to probe on unknown adapter [name='%s',id=0x%x]\n",adapter->name,adapter->id);
return -ENODEV; return -ENODEV;
} }
......
...@@ -441,9 +441,7 @@ static struct i2c_client client_template = ...@@ -441,9 +441,7 @@ static struct i2c_client client_template =
{ {
.flags = I2C_CLIENT_ALLOW_USE, .flags = I2C_CLIENT_ALLOW_USE,
.driver = &driver, .driver = &driver,
.dev = {
.name = "tda9887", .name = "tda9887",
},
}; };
static int tda9887_init_module(void) static int tda9887_init_module(void)
......
...@@ -72,7 +72,7 @@ static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -72,7 +72,7 @@ static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind)
} }
/* fill client structure */ /* fill client structure */
sprintf(client->dev.name,"tea6415c (0x%02x)", address); sprintf(client->name,"tea6415c (0x%02x)", address);
client->id = tea6415c_id++; client->id = tea6415c_id++;
client->flags = 0; client->flags = 0;
client->addr = address; client->addr = address;
...@@ -85,7 +85,7 @@ static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -85,7 +85,7 @@ static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind)
return err; return err;
} }
printk("tea6415c.o: detected @ 0x%02x on adapter %s\n",2*address,&client->adapter->dev.name[0]); printk("tea6415c.o: detected @ 0x%02x on adapter %s\n",2*address,&client->adapter->name[0]);
return 0; return 0;
} }
...@@ -94,7 +94,7 @@ static int tea6415c_attach(struct i2c_adapter *adapter) ...@@ -94,7 +94,7 @@ static int tea6415c_attach(struct i2c_adapter *adapter)
{ {
/* let's see whether this is a know adapter we can attach to */ /* let's see whether this is a know adapter we can attach to */
if( adapter->id != I2C_ALGO_SAA7146 ) { if( adapter->id != I2C_ALGO_SAA7146 ) {
dprintk("tea6415c.o: refusing to probe on unknown adapter [name='%s',id=0x%x]\n",adapter->dev.name,adapter->id); dprintk("tea6415c.o: refusing to probe on unknown adapter [name='%s',id=0x%x]\n",adapter->name,adapter->id);
return -ENODEV; return -ENODEV;
} }
......
...@@ -112,7 +112,7 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -112,7 +112,7 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind)
} }
/* fill client structure */ /* fill client structure */
sprintf(client->dev.name,"tea6420 (0x%02x)", address); sprintf(client->name,"tea6420 (0x%02x)", address);
client->id = tea6420_id++; client->id = tea6420_id++;
client->flags = 0; client->flags = 0;
client->addr = address; client->addr = address;
...@@ -135,7 +135,7 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -135,7 +135,7 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind)
printk("tea6420.o: could not initialize chipset. continuing anyway.\n"); printk("tea6420.o: could not initialize chipset. continuing anyway.\n");
} }
printk("tea6420.o: detected @ 0x%02x on adapter %s\n",2*address,&client->adapter->dev.name[0]); printk("tea6420.o: detected @ 0x%02x on adapter %s\n",2*address,&client->adapter->name[0]);
return 0; return 0;
} }
...@@ -144,7 +144,7 @@ static int tea6420_attach(struct i2c_adapter *adapter) ...@@ -144,7 +144,7 @@ static int tea6420_attach(struct i2c_adapter *adapter)
{ {
/* let's see whether this is a know adapter we can attach to */ /* let's see whether this is a know adapter we can attach to */
if( adapter->id != I2C_ALGO_SAA7146 ) { if( adapter->id != I2C_ALGO_SAA7146 ) {
dprintk("tea6420.o: refusing to probe on unknown adapter [name='%s',id=0x%x]\n",adapter->dev.name,adapter->id); dprintk("tea6420.o: refusing to probe on unknown adapter [name='%s',id=0x%x]\n",adapter->name,adapter->id);
return -ENODEV; return -ENODEV;
} }
......
...@@ -197,9 +197,7 @@ static struct i2c_client client_template = ...@@ -197,9 +197,7 @@ static struct i2c_client client_template =
{ {
.id = -1, .id = -1,
.driver = &i2c_driver_tuner, .driver = &i2c_driver_tuner,
.dev = {
.name = "SAB3036", .name = "SAB3036",
},
}; };
int __init int __init
......
...@@ -824,7 +824,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -824,7 +824,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
if (type < TUNERS) { if (type < TUNERS) {
t->type = type; t->type = type;
printk("tuner(bttv): type forced to %d (%s) [insmod]\n",t->type,tuners[t->type].name); printk("tuner(bttv): type forced to %d (%s) [insmod]\n",t->type,tuners[t->type].name);
strlcpy(client->dev.name, tuners[t->type].name, DEVICE_NAME_SIZE); strlcpy(client->name, tuners[t->type].name, DEVICE_NAME_SIZE);
} }
i2c_attach_client(client); i2c_attach_client(client);
if (t->type == TUNER_MT2032) if (t->type == TUNER_MT2032)
...@@ -875,7 +875,7 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -875,7 +875,7 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
t->type = *iarg; t->type = *iarg;
printk("tuner: type set to %d (%s)\n", printk("tuner: type set to %d (%s)\n",
t->type,tuners[t->type].name); t->type,tuners[t->type].name);
strlcpy(client->dev.name, tuners[t->type].name, DEVICE_NAME_SIZE); strlcpy(client->name, tuners[t->type].name, DEVICE_NAME_SIZE);
if (t->type == TUNER_MT2032) if (t->type == TUNER_MT2032)
mt2032_init(client); mt2032_init(client);
break; break;
...@@ -962,9 +962,7 @@ static struct i2c_client client_template = ...@@ -962,9 +962,7 @@ static struct i2c_client client_template =
{ {
.flags = I2C_CLIENT_ALLOW_USE, .flags = I2C_CLIENT_ALLOW_USE,
.driver = &driver, .driver = &driver,
.dev = {
.name = "(tuner unset)", .name = "(tuner unset)",
},
}; };
static int tuner_init_module(void) static int tuner_init_module(void)
......
...@@ -166,6 +166,7 @@ struct i2c_client { ...@@ -166,6 +166,7 @@ struct i2c_client {
/* to the client */ /* to the client */
struct device dev; /* the device structure */ struct device dev; /* the device structure */
struct list_head list; struct list_head list;
char name[DEVICE_NAME_SIZE];
}; };
#define to_i2c_client(d) container_of(d, struct i2c_client, dev) #define to_i2c_client(d) container_of(d, struct i2c_client, dev)
...@@ -179,11 +180,11 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) ...@@ -179,11 +180,11 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
dev_set_drvdata (&dev->dev, data); dev_set_drvdata (&dev->dev, data);
} }
#define I2C_DEVNAME(str) .dev = { .name = str } #define I2C_DEVNAME(str) .name = str
static inline char *i2c_clientname(struct i2c_client *c) static inline char *i2c_clientname(struct i2c_client *c)
{ {
return c->dev.name; return &c->name[0];
} }
/* /*
...@@ -251,6 +252,7 @@ struct i2c_adapter { ...@@ -251,6 +252,7 @@ struct i2c_adapter {
int nr; int nr;
struct list_head clients; struct list_head clients;
struct list_head list; struct list_head list;
char name[DEVICE_NAME_SIZE];
}; };
#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment