From 521a2590bfba6e620680e9722369cbaae37ccdbb Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 8 Aug 2003 02:15:11 -0700 Subject: [PATCH] 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. --- drivers/i2c/busses/i2c-ali1535.c | 6 ++---- drivers/i2c/busses/i2c-ali15x3.c | 6 ++---- drivers/i2c/busses/i2c-amd756.c | 6 ++---- drivers/i2c/busses/i2c-amd8111.c | 2 +- drivers/i2c/busses/i2c-i801.c | 6 ++---- drivers/i2c/busses/i2c-isa.c | 4 +--- drivers/i2c/busses/i2c-nforce2.c | 6 ++---- drivers/i2c/busses/i2c-piix4.c | 8 +++----- drivers/i2c/busses/i2c-sis96x.c | 6 ++---- drivers/i2c/busses/i2c-viapro.c | 6 ++---- drivers/i2c/chips/adm1021.c | 2 +- drivers/i2c/chips/it87.c | 2 +- drivers/i2c/chips/lm75.c | 2 +- drivers/i2c/chips/lm78.c | 2 +- drivers/i2c/chips/lm85.c | 12 ++++++------ drivers/i2c/chips/via686a.c | 2 +- drivers/i2c/chips/w83781d.c | 4 ++-- drivers/i2c/i2c-algo-bit.c | 2 +- drivers/i2c/i2c-core.c | 4 ++-- drivers/i2c/i2c-dev.c | 4 +--- drivers/i2c/i2c-elektor.c | 4 +--- drivers/i2c/i2c-elv.c | 4 +--- drivers/i2c/i2c-philips-par.c | 4 +--- drivers/i2c/i2c-prosavage.c | 5 ----- drivers/i2c/i2c-velleman.c | 4 +--- drivers/i2c/scx200_acb.c | 4 ++-- drivers/media/common/saa7146_i2c.c | 3 +-- drivers/media/video/adv7175.c | 22 +++++++++------------ drivers/media/video/bt819.c | 24 +++++++++++------------ drivers/media/video/bt856.c | 20 +++++++++---------- drivers/media/video/bttv-cards.c | 2 +- drivers/media/video/msp3400.c | 2 +- drivers/media/video/saa5249.c | 6 ++---- drivers/media/video/saa7110.c | 10 ++++------ drivers/media/video/saa7111.c | 15 ++++++-------- drivers/media/video/saa7134/saa7134-i2c.c | 2 +- drivers/media/video/saa7185.c | 13 +++++------- drivers/media/video/tda9840.c | 6 +++--- drivers/media/video/tda9887.c | 4 +--- drivers/media/video/tea6415c.c | 6 +++--- drivers/media/video/tea6420.c | 6 +++--- drivers/media/video/tuner-3036.c | 4 +--- drivers/media/video/tuner.c | 8 +++----- include/linux/i2c.h | 6 ++++-- 44 files changed, 110 insertions(+), 166 deletions(-) diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c index 66720c091152f..33c140678124e 100644 --- a/drivers/i2c/busses/i2c-ali1535.c +++ b/drivers/i2c/busses/i2c-ali1535.c @@ -483,9 +483,7 @@ static struct i2c_adapter ali1535_adapter = { .owner = THIS_MODULE, .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI1535, .algo = &smbus_algorithm, - .dev = { - .name = "unset", - } + .name = "unset", }; static struct pci_device_id ali1535_ids[] = { @@ -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 */ 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); return i2c_add_adapter(&ali1535_adapter); } diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c index 95e4866bc10a0..d7e76bc389c90 100644 --- a/drivers/i2c/busses/i2c-ali15x3.c +++ b/drivers/i2c/busses/i2c-ali15x3.c @@ -474,9 +474,7 @@ static struct i2c_adapter ali15x3_adapter = { .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI15X3, .class = I2C_ADAP_CLASS_SMBUS, .algo = &smbus_algorithm, - .dev = { - .name = "unset", - }, + .name = "unset", }; static struct pci_device_id ali15x3_ids[] = { @@ -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 */ 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); return i2c_add_adapter(&ali15x3_adapter); } diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index d6ca0f0e9da34..1b9ad3179ad68 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c @@ -307,9 +307,7 @@ static struct i2c_adapter amd756_adapter = { .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD756, .class = I2C_ADAP_CLASS_SMBUS, .algo = &smbus_algorithm, - .dev = { - .name = "unset", - }, + .name = "unset", }; enum chiptype { AMD756, AMD766, AMD768, NFORCE }; @@ -371,7 +369,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev, /* set up the driverfs linkage to our parent device */ 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); error = i2c_add_adapter(&amd756_adapter); diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c index c74475ea97b73..9dc1b0a7be799 100644 --- a/drivers/i2c/busses/i2c-amd8111.c +++ b/drivers/i2c/busses/i2c-amd8111.c @@ -356,7 +356,7 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_ goto out_kfree; 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); smbus->adapter.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD8111; smbus->adapter.class = I2C_ADAP_CLASS_SMBUS; diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 6059c27b3cc7f..9ea4927a2b142 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -543,9 +543,7 @@ static struct i2c_adapter i801_adapter = { .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_I801, .class = I2C_ADAP_CLASS_SMBUS, .algo = &smbus_algorithm, - .dev = { - .name = "unset", - }, + .name = "unset", }; 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 /* set up the driverfs linkage to our parent device */ 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); return i2c_add_adapter(&i801_adapter); } diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c index c49a874764e54..4cbda18c7663b 100644 --- a/drivers/i2c/busses/i2c-isa.c +++ b/drivers/i2c/busses/i2c-isa.c @@ -42,9 +42,7 @@ static struct i2c_adapter isa_adapter = { .id = I2C_ALGO_ISA | I2C_HW_ISA, .class = I2C_ADAP_CLASS_SMBUS, .algo = &isa_algorithm, - .dev = { - .name = "ISA main adapter", - }, + .name = "ISA main adapter", }; static int __init i2c_isa_init(void) diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index 5834424d88c65..e8496c5ab597d 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c @@ -125,9 +125,7 @@ static struct i2c_adapter nforce2_adapter = { .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_NFORCE2, .class = I2C_ADAP_CLASS_SMBUS, .algo = &smbus_algorithm, - .dev = { - .name = "unset", - }, + .name = "unset", }; @@ -342,7 +340,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int reg, */ smbus->adapter = nforce2_adapter; 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); error = i2c_add_adapter(&smbus->adapter); diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index e2c30762206cf..ce5a6c8247db0 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -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) 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()) { dev_err(&PIIX4_dev->dev, "IBM Laptop detected; this module " @@ -389,9 +389,7 @@ static struct i2c_adapter piix4_adapter = { .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_PIIX4, .class = I2C_ADAP_CLASS_SMBUS, .algo = &smbus_algorithm, - .dev = { - .name = "unset", - }, + .name = "unset", }; 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 /* set up the driverfs linkage to our parent device */ 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); retval = i2c_add_adapter(&piix4_adapter); diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c index baf4ec309f7b4..4e5a5af9f638d 100644 --- a/drivers/i2c/busses/i2c-sis96x.c +++ b/drivers/i2c/busses/i2c-sis96x.c @@ -264,9 +264,7 @@ static struct i2c_adapter sis96x_adapter = { .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_SIS96X, .class = I2C_ADAP_CLASS_SMBUS, .algo = &smbus_algorithm, - .dev = { - .name ="unset", - }, + .name = "unset", }; static struct pci_device_id sis96x_ids[] = { @@ -320,7 +318,7 @@ static int __devinit sis96x_probe(struct pci_dev *dev, /* set up the driverfs linkage to our parent device */ 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); if ((retval = i2c_add_adapter(&sis96x_adapter))) { diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c index 5360cbdc8036f..b4238dcba725c 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c @@ -290,9 +290,7 @@ static struct i2c_adapter vt596_adapter = { .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_VIA2, .class = I2C_ADAP_CLASS_SMBUS, .algo = &smbus_algorithm, - .dev = { - .name = "unset", - }, + .name = "unset", }; 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); 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); return i2c_add_adapter(&vt596_adapter); diff --git a/drivers/i2c/chips/adm1021.c b/drivers/i2c/chips/adm1021.c index 739ce6e2bc38c..cf6860dd33e53 100644 --- a/drivers/i2c/chips/adm1021.c +++ b/drivers/i2c/chips/adm1021.c @@ -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 */ - strlcpy(new_client->dev.name, client_name, DEVICE_NAME_SIZE); + strlcpy(new_client->name, client_name, DEVICE_NAME_SIZE); data->type = kind; new_client->id = adm1021_id++; diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c index 8d04da1fbe1a6..16181e1fea9c6 100644 --- a/drivers/i2c/chips/it87.c +++ b/drivers/i2c/chips/it87.c @@ -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 */ - strlcpy(new_client->dev.name, name, DEVICE_NAME_SIZE); + strlcpy(new_client->name, name, DEVICE_NAME_SIZE); data->type = kind; diff --git a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c index ab4e4ab23b540..e1ee02327b8e1 100644 --- a/drivers/i2c/chips/lm75.c +++ b/drivers/i2c/chips/lm75.c @@ -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 */ - strlcpy(new_client->dev.name, name, DEVICE_NAME_SIZE); + strlcpy(new_client->name, name, DEVICE_NAME_SIZE); new_client->id = lm75_id++; data->valid = 0; diff --git a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c index 2dbdf60a87f65..ccca9415d448f 100644 --- a/drivers/i2c/chips/lm78.c +++ b/drivers/i2c/chips/lm78.c @@ -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 */ - strlcpy(new_client->dev.name, client_name, DEVICE_NAME_SIZE); + strlcpy(new_client->name, client_name, DEVICE_NAME_SIZE); data->type = kind; data->valid = 0; diff --git a/drivers/i2c/chips/lm85.c b/drivers/i2c/chips/lm85.c index a704f5959b566..e700a01376ea5 100644 --- a/drivers/i2c/chips/lm85.c +++ b/drivers/i2c/chips/lm85.c @@ -853,19 +853,19 @@ int lm85_detect(struct i2c_adapter *adapter, int address, /* Fill in the chip specific driver values */ if ( kind == any_chip ) { 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 ) { 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 ) { 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 ) { 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 ) { 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 { dev_dbg(&adapter->dev, "Internal error, invalid kind (%d)!", kind); err = -EFAULT ; @@ -880,7 +880,7 @@ int lm85_detect(struct i2c_adapter *adapter, int address, if (lm85debug) { 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), new_client->addr); } diff --git a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c index d027bd9c31b62..d5d36c6bb21a6 100644 --- a/drivers/i2c/chips/via686a.c +++ b/drivers/i2c/chips/via686a.c @@ -727,7 +727,7 @@ static int via686a_detect(struct i2c_adapter *adapter, int address, int kind) new_client->dev.parent = &adapter->dev; /* 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; init_MUTEX(&data->update_lock); diff --git a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c index 6676a84d78bd5..bfbe794eb687c 100644 --- a/drivers/i2c/chips/w83781d.c +++ b/drivers/i2c/chips/w83781d.c @@ -1116,7 +1116,7 @@ w83781d_detect_subclients(struct i2c_adapter *adapter, int address, int kind, data->lm75[i]->adapter = adapter; data->lm75[i]->driver = &w83781d_driver; data->lm75[i]->flags = 0; - strlcpy(data->lm75[i]->dev.name, client_name, + strlcpy(data->lm75[i]->name, client_name, DEVICE_NAME_SIZE); if ((err = i2c_attach_client(data->lm75[i]))) { dev_err(&new_client->dev, "Subclient %d " @@ -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 */ - strlcpy(new_client->dev.name, client_name, DEVICE_NAME_SIZE); + strlcpy(new_client->name, client_name, DEVICE_NAME_SIZE); data->type = kind; data->valid = 0; diff --git a/drivers/i2c/i2c-algo-bit.c b/drivers/i2c/i2c-algo-bit.c index 48b69f61d1efc..f8330b3ef5d31 100644 --- a/drivers/i2c/i2c-algo-bit.c +++ b/drivers/i2c/i2c-algo-bit.c @@ -527,7 +527,7 @@ int i2c_bit_add_bus(struct i2c_adapter *adap) struct i2c_algo_bit_data *bit_adap = adap->algo_data; if (bit_test) { - int ret = test_bus(bit_adap, adap->dev.name); + int ret = test_bus(bit_adap, adap->name); if (ret<0) return -ENODEV; } diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index a200d525ccf79..99b9765cf0be1 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -250,7 +250,7 @@ int i2c_del_driver(struct i2c_driver *driver) continue; DEB2(printk(KERN_DEBUG "i2c-core.o: " "detaching client %s:\n", - client->dev.name)); + client->name)); if ((res = driver->detach_client(client))) { dev_err(&adap->dev, "while " "unregistering driver " @@ -352,7 +352,7 @@ int i2c_detach_client(struct i2c_client *client) if (res) { printk(KERN_ERR "i2c-core.o: client_unregister [%s] failed, " - "client not detached", client->dev.name); + "client not detached", client->name); goto out; } } diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 2e5426fff4898..b601d51fa9b7d 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -484,9 +484,7 @@ static struct i2c_driver i2cdev_driver = { }; static struct i2c_client i2cdev_client_template = { - .dev = { - .name = "I2C /dev entry", - }, + .name = "I2C /dev entry", .id = 1, .addr = -1, .driver = &i2cdev_driver, diff --git a/drivers/i2c/i2c-elektor.c b/drivers/i2c/i2c-elektor.c index 9b42498996b86..1a38e1f6eaac9 100644 --- a/drivers/i2c/i2c-elektor.c +++ b/drivers/i2c/i2c-elektor.c @@ -178,9 +178,7 @@ static struct i2c_adapter pcf_isa_ops = { .owner = THIS_MODULE, .id = I2C_HW_P_ELEK, .algo_data = &pcf_isa_data, - .dev = { - .name = "PCF8584 ISA adapter", - }, + .name = "PCF8584 ISA adapter", }; static int __init i2c_pcfisa_init(void) diff --git a/drivers/i2c/i2c-elv.c b/drivers/i2c/i2c-elv.c index 82237f6651fa9..2045dc32b044f 100644 --- a/drivers/i2c/i2c-elv.c +++ b/drivers/i2c/i2c-elv.c @@ -131,9 +131,7 @@ static struct i2c_adapter bit_elv_ops = { .owner = THIS_MODULE, .id = I2C_HW_B_ELV, .algo_data = &bit_elv_data, - .dev = { - .name = "ELV Parallel port adaptor", - }, + .name = "ELV Parallel port adaptor", }; static int __init i2c_bitelv_init(void) diff --git a/drivers/i2c/i2c-philips-par.c b/drivers/i2c/i2c-philips-par.c index ee8ae073f7ff6..3c2ea43574c4a 100644 --- a/drivers/i2c/i2c-philips-par.c +++ b/drivers/i2c/i2c-philips-par.c @@ -152,9 +152,7 @@ static struct i2c_algo_bit_data bit_lp_data2 = { static struct i2c_adapter bit_lp_ops = { .owner = THIS_MODULE, .id = I2C_HW_B_LP, - .dev = { - .name = "Philips Parallel port adapter", - }, + .name = "Philips Parallel port adapter", }; static void i2c_parport_attach (struct parport *port) diff --git a/drivers/i2c/i2c-prosavage.c b/drivers/i2c/i2c-prosavage.c index 428bdc5c1f8be..03841dd9fb09d 100644 --- a/drivers/i2c/i2c-prosavage.c +++ b/drivers/i2c/i2c-prosavage.c @@ -70,12 +70,7 @@ #define DRIVER_ID "i2c-prosavage" #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 -#else -#define ADAPTER_NAME(x) (x).dev.name -#endif /* LINUX_VERSION_CODE */ #define MAX_BUSSES 2 diff --git a/drivers/i2c/i2c-velleman.c b/drivers/i2c/i2c-velleman.c index 13b2e5ea32243..c5fccb7b37b0a 100644 --- a/drivers/i2c/i2c-velleman.c +++ b/drivers/i2c/i2c-velleman.c @@ -116,9 +116,7 @@ static struct i2c_adapter bit_velle_ops = { .owner = THIS_MODULE, .id = I2C_HW_B_VELLE, .algo_data = &bit_velle_data, - .dev = { - .name = "Velleman K8000", - }, + .name = "Velleman K8000", }; static int __init i2c_bitvelle_init(void) diff --git a/drivers/i2c/scx200_acb.c b/drivers/i2c/scx200_acb.c index 74e165cd8982d..34a6db05f7f2d 100644 --- a/drivers/i2c/scx200_acb.c +++ b/drivers/i2c/scx200_acb.c @@ -456,14 +456,14 @@ static int __init scx200_acb_create(int base, int index) memset(iface, 0, sizeof(*iface)); adapter = &iface->adapter; 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->id = I2C_ALGO_SMBUS; adapter->algo = &scx200_acb_algorithm; 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) { dev_err(&adapter->dev, "can't allocate io 0x%x-0x%x\n", base, base + 8-1); diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c index c23e5c829822d..8775a874caf2b 100644 --- a/drivers/media/common/saa7146_i2c.c +++ b/drivers/media/common/saa7146_i2c.c @@ -407,11 +407,10 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c if( NULL != 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); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) i2c_adapter->data = dev; #else - strcpy(i2c_adapter->dev.name, dev->name); i2c_set_adapdata(i2c_adapter,dev); #endif i2c_adapter->algo = &saa7146_algo; diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c index a3e4a766da732..3f3adcca4ba15 100644 --- a/drivers/media/video/adv7175.c +++ b/drivers/media/video/adv7175.c @@ -159,7 +159,7 @@ static const unsigned char init_ntsc[] = { 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 i2c_client *client; @@ -191,7 +191,7 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla // We should never get here!!! dname = unknown_name; } - strlcpy(client->dev.name, dname, DEVICE_NAME_SIZE); + strlcpy(client->name, dname, DEVICE_NAME_SIZE); init_MUTEX(&encoder->lock); encoder->client = client; i2c_set_clientdata(client, encoder); @@ -203,7 +203,7 @@ static int adv717x_attach(struct i2c_adapter *adap, int addr, unsigned short fla for (i=1; idev.name, rv); + printk(KERN_ERR "%s_attach: init error %d\n", client->name, rv); break; } } @@ -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_read_byte_data(client,0x12); 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); @@ -297,9 +297,8 @@ static int adv717x_command(struct i2c_client *client, unsigned int cmd, i2c_smbus_write_byte_data(client,0x07, TR0MODE); break; default: - printk(KERN_ERR - "%s: illegal norm: %d\n", - client->dev.name, iarg); + printk(KERN_ERR "%s: illegal norm: %d\n", + client->name, iarg); return -EINVAL; } @@ -353,9 +352,8 @@ static int adv717x_command(struct i2c_client *client, unsigned int cmd, break; default: - printk(KERN_ERR - "%s: illegal input: %d\n", - client->dev.name, iarg); + printk(KERN_ERR "%s: illegal input: %d\n", + client->name, iarg); return -EINVAL; } @@ -422,9 +420,7 @@ static struct i2c_driver i2c_driver_adv7176 = { static struct i2c_client client_template = { .driver = &i2c_driver_adv7175, - .dev = { - .name = "adv7175_client", - }, + .name = "adv7175_client", }; static int adv717x_init(void) diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index 365ecc577ccc8..9cb5152e010f8 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c @@ -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; struct bt819 *decoder; @@ -172,7 +172,7 @@ static int bt819_attach(struct i2c_adapter *adap, int addr , unsigned long flags } 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); decoder->client = client; decoder->addr = addr; @@ -188,10 +188,10 @@ static int bt819_attach(struct i2c_adapter *adap, int addr , unsigned long flags i = bt819_init(client); if (i < 0) { printk(KERN_ERR "%s: bt819_attach: init status %d\n", - decoder->client->dev.name, i); + decoder->client->name, i); } else { 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); } init_MUTEX(&decoder->lock); @@ -270,7 +270,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) *iarg = res; DEBUG(printk(KERN_INFO "%s-bt819: get status %x\n", - decoder->client->dev.name, *iarg)); + decoder->client->name, *iarg)); } break; @@ -280,7 +280,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) struct timing *timing; DEBUG(printk(KERN_INFO "%s-bt819: set norm %x\n", - decoder->client->dev.name, *iarg)); + decoder->client->name, *iarg)); if (*iarg == VIDEO_MODE_NTSC) { bt819_setbit(decoder, 0x01, 0, 1); @@ -321,7 +321,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) int *iarg = arg; DEBUG(printk(KERN_INFO "%s-bt819: set input %x\n", - decoder->client->dev.name, *iarg)); + decoder->client->name, *iarg)); if (*iarg < 0 || *iarg > 7) { return -EINVAL; @@ -346,7 +346,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) int *iarg = arg; DEBUG(printk(KERN_INFO "%s-bt819: set output %x\n", - decoder->client->dev.name, *iarg)); + decoder->client->name, *iarg)); /* not much choice of outputs */ if (*iarg != 0) { @@ -362,7 +362,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) DEBUG(printk (KERN_INFO "%s-bt819: enable output %x\n", - decoder->client->dev.name, *iarg)); + decoder->client->name, *iarg)); if (decoder->enable != enable) { decoder->enable = enable; @@ -383,7 +383,7 @@ static int bt819_command(struct i2c_client *client, unsigned int cmd, void *arg) DEBUG(printk (KERN_INFO "%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)); @@ -452,9 +452,7 @@ static struct i2c_driver i2c_driver_bt819 = { static struct i2c_client client_template = { .id = -1, .driver = &i2c_driver_bt819, - .dev = { - .name = "bt819_client", - }, + .name = "bt819_client", }; static int bt819_setup(void) diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c index ddd68c5352d48..0888febb38310 100644 --- a/drivers/media/video/bt856.c +++ b/drivers/media/video/bt856.c @@ -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 i2c_client *client; @@ -123,14 +123,14 @@ static int bt856_attach(struct i2c_adapter *adap, int addr , unsigned long flags memset(encoder, 0, sizeof(struct bt856)); - strlcpy(client->dev.name, "bt856", DEVICE_NAME_SIZE); + strlcpy(client->name, "bt856", DEVICE_NAME_SIZE); encoder->client = client; i2c_set_clientdata(client, encoder); encoder->addr = client->addr; encoder->norm = VIDEO_MODE_NTSC; 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); encoder->reg[0xdc] = 0x18; @@ -190,7 +190,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, DEBUG(printk (KERN_INFO "%s-bt856: get capabilities\n", - encoder->client->dev.name)); + encoder->client->name)); cap->flags = VIDEO_ENCODER_PAL @@ -205,7 +205,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, int *iarg = arg; DEBUG(printk(KERN_INFO "%s-bt856: set norm %d\n", - encoder->client->dev.name, *iarg)); + encoder->client->name, *iarg)); switch (*iarg) { @@ -232,7 +232,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, int *iarg = arg; DEBUG(printk(KERN_INFO "%s-bt856: set input %d\n", - encoder->client->dev.name, *iarg)); + encoder->client->name, *iarg)); /* We only have video bus. *iarg = 0: input is from bt819 @@ -268,7 +268,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, int *iarg = arg; DEBUG(printk(KERN_INFO "%s-bt856: set output %d\n", - encoder->client->dev.name, *iarg)); + encoder->client->name, *iarg)); /* not much choice of outputs */ if (*iarg != 0) { @@ -285,7 +285,7 @@ static int bt856_command(struct i2c_client *client, unsigned int cmd, DEBUG(printk (KERN_INFO "%s-bt856: enable output %d\n", - encoder->client->dev.name, encoder->enable)); + encoder->client->name, encoder->enable)); } break; @@ -311,9 +311,7 @@ static struct i2c_driver i2c_driver_bt856 = { static struct i2c_client client_template = { .id = -1, .driver = &i2c_driver_bt856, - .dev = { - .name = "bt856_client", - }, + .name = "bt856_client", }; static int bt856_init(void) diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c index c61cd8a76a366..7cbfb45bff2dd 100644 --- a/drivers/media/video/bttv-cards.c +++ b/drivers/media/video/bttv-cards.c @@ -3469,7 +3469,7 @@ void __devinit bttv_check_chipset(void) /* print which chipset we have */ 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 */ if (triton1) diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index 9c4887b0dbc43..43b1e68537c2f 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c @@ -1316,7 +1316,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind) #endif 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->rev1>>8)&0xff)+'@', msp->rev2&0x1f); diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c index ab533fc569cc9..ad4626bb68e96 100644 --- a/drivers/media/video/saa5249.c +++ b/drivers/media/video/saa5249.c @@ -171,7 +171,7 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind) return -ENOMEM; } 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); /* @@ -263,9 +263,7 @@ static struct i2c_driver i2c_driver_videotext = static struct i2c_client client_template = { .id = -1, .driver = &i2c_driver_videotext, - .dev = { - .name = "(unset)", - }, + .name = "(unset)", }; /* diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c index d89084e17cc2b..c1cb663c67493 100644 --- a/drivers/media/video/saa7110.c +++ b/drivers/media/video/saa7110.c @@ -147,7 +147,7 @@ int determine_norm(struct i2c_client* client) } 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[] = { 0, 0x4C, 0x3C, 0x0D, 0xEF, 0xBD, 0xF0, 0x00, 0x00, @@ -176,7 +176,7 @@ static const unsigned char initseq[] = { /* clear our private data */ 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; i2c_set_clientdata(client, decoder); decoder->addr = addr; @@ -190,7 +190,7 @@ static const unsigned char initseq[] = { rv = i2c_master_send(client, initseq, sizeof(initseq)); 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 { i2c_smbus_write_byte_data(client,0x21,0x16); i2c_smbus_write_byte_data(client,0x0D,0x04); @@ -393,9 +393,7 @@ static struct i2c_driver i2c_driver_saa7110 = static struct i2c_client client_template = { .id = -1, .driver = &i2c_driver_saa7110, - .dev = { - .name = "saa7110_client", - }, + .name = "saa7110_client", }; static int saa7110_init(void) diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c index 870313cc03e12..2868285b8a904 100644 --- a/drivers/media/video/saa7111.c +++ b/drivers/media/video/saa7111.c @@ -122,7 +122,7 @@ static int saa7111_attach(struct i2c_adapter *adap, int addr, int kind) } memset(decoder, 0, sizeof(*decoder)); - strlcpy(client->dev.name, "saa7111", DEVICE_NAME_SIZE); + strlcpy(client->name, "saa7111", DEVICE_NAME_SIZE); decoder->client = client; i2c_set_clientdata(client, decoder); decoder->addr = addr; @@ -137,10 +137,10 @@ static int saa7111_attach(struct i2c_adapter *adap, int addr, int kind) i = i2c_master_send(client, init, sizeof(init)); if (i < 0) { printk(KERN_ERR "%s_attach: init status %d\n", - client->dev.name, i); + client->name, i); } else { 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); @@ -159,7 +159,7 @@ static int saa7111_probe(struct i2c_adapter *adap) } 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); } @@ -188,8 +188,7 @@ static int saa7111_command(struct i2c_client *client, unsigned int cmd, for (i = 0; i < 32; i += 16) { int j; - printk("KERN_DEBUG %s: %03x", client->dev.name, - i); + printk("KERN_DEBUG %s: %03x", client->name, i); for (j = 0; j < 16; ++j) { printk(" %02x", i2c_smbus_read_byte_data(client, @@ -413,9 +412,7 @@ static struct i2c_driver i2c_driver_saa7111 = { static struct i2c_client client_template = { .id = -1, .driver = &i2c_driver_saa7111, - .dev = { - .name = "saa7111_client", - }, + .name = "saa7111_client", }; static int saa7111_init(void) diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c index f49b49f5d0a1d..c15ef076a41b8 100644 --- a/drivers/media/video/saa7134/saa7134-i2c.c +++ b/drivers/media/video/saa7134/saa7134-i2c.c @@ -399,7 +399,7 @@ void saa7134_i2c_call_clients(struct saa7134_dev *dev, int saa7134_i2c_register(struct saa7134_dev *dev) { 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; i2c_add_adapter(&dev->i2c_adap); diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c index 8734ed58bc423..e99c87b26cbbd 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c @@ -181,7 +181,7 @@ static const unsigned char init_ntsc[] = { 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; struct saa7185 *encoder; @@ -202,7 +202,7 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla memset(encoder, 0, sizeof(*encoder)); - strlcpy(client->dev.name, "saa7185", DEVICE_NAME_SIZE); + strlcpy(client->name, "saa7185", DEVICE_NAME_SIZE); encoder->client = client; i2c_set_clientdata(client, encoder); encoder->addr = addr; @@ -215,11 +215,10 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla sizeof(init_ntsc)); } if (i < 0) { - printk(KERN_ERR "%s_attach: init error %d\n", client->dev.name, - i); + printk(KERN_ERR "%s_attach: init error %d\n", client->name, i); } else { 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); i2c_attach_client(client); @@ -367,9 +366,7 @@ static struct i2c_driver i2c_driver_saa7185 = { static struct i2c_client client_template = { .id = -1, .driver = &i2c_driver_saa7185, - .dev = { - .name = "saa7185_client", - }, + .name = "saa7185_client", }; static int saa7185_init(void) diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c index 275fe5f1d849d..873f96bf605f6 100644 --- a/drivers/media/video/tda9840.c +++ b/drivers/media/video/tda9840.c @@ -198,7 +198,7 @@ static int tda9840_detect(struct i2c_adapter *adapter, int address, int kind) } /* fill client structure */ - sprintf(client->dev.name,"tda9840 (0x%02x)", address); + sprintf(client->name,"tda9840 (0x%02x)", address); client->id = tda9840_id++; client->flags = 0; client->addr = address; @@ -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: 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; } @@ -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 */ 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; } diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 080cfba95fb33..2fcf6c685bbae 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -441,9 +441,7 @@ static struct i2c_client client_template = { .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, - .dev = { - .name = "tda9887", - }, + .name = "tda9887", }; static int tda9887_init_module(void) diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c index 9fa7c34b54b09..6ee48f15602fc 100644 --- a/drivers/media/video/tea6415c.c +++ b/drivers/media/video/tea6415c.c @@ -72,7 +72,7 @@ static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind) } /* fill client structure */ - sprintf(client->dev.name,"tea6415c (0x%02x)", address); + sprintf(client->name,"tea6415c (0x%02x)", address); client->id = tea6415c_id++; client->flags = 0; client->addr = address; @@ -85,7 +85,7 @@ static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind) 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; } @@ -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 */ 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; } diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c index 74ea97c1f2d90..206c7ec73af01 100644 --- a/drivers/media/video/tea6420.c +++ b/drivers/media/video/tea6420.c @@ -112,7 +112,7 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind) } /* fill client structure */ - sprintf(client->dev.name,"tea6420 (0x%02x)", address); + sprintf(client->name,"tea6420 (0x%02x)", address); client->id = tea6420_id++; client->flags = 0; client->addr = address; @@ -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: 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; } @@ -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 */ 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; } diff --git a/drivers/media/video/tuner-3036.c b/drivers/media/video/tuner-3036.c index 61513bb0fae9b..3e06dc8ef8c3d 100644 --- a/drivers/media/video/tuner-3036.c +++ b/drivers/media/video/tuner-3036.c @@ -197,9 +197,7 @@ static struct i2c_client client_template = { .id = -1, .driver = &i2c_driver_tuner, - .dev = { - .name = "SAB3036", - }, + .name = "SAB3036", }; int __init diff --git a/drivers/media/video/tuner.c b/drivers/media/video/tuner.c index b7d84695612f4..b1760ae9b6b14 100644 --- a/drivers/media/video/tuner.c +++ b/drivers/media/video/tuner.c @@ -824,7 +824,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) if (type < TUNERS) { t->type = type; 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); if (t->type == TUNER_MT2032) @@ -875,7 +875,7 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) t->type = *iarg; printk("tuner: type set to %d (%s)\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); if (t->type == TUNER_MT2032) mt2032_init(client); break; @@ -962,9 +962,7 @@ static struct i2c_client client_template = { .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, - .dev = { - .name = "(tuner unset)", - }, + .name = "(tuner unset)", }; static int tuner_init_module(void) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 43a277eabcd9b..b8b3c6a1d6010 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -166,6 +166,7 @@ struct i2c_client { /* to the client */ struct device dev; /* the device structure */ struct list_head list; + char name[DEVICE_NAME_SIZE]; }; #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) 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) { - return c->dev.name; + return &c->name[0]; } /* @@ -251,6 +252,7 @@ struct i2c_adapter { int nr; struct list_head clients; struct list_head list; + char name[DEVICE_NAME_SIZE]; }; #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) -- 2.53.0