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 = {
.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);
}
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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)
......
......@@ -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);
......
......@@ -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);
......
......@@ -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))) {
......
......@@ -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);
......
......@@ -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++;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
}
}
......
......@@ -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,
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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
......
......@@ -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)
......
......@@ -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);
......
......@@ -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;
......
......@@ -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; i<x_common; i++) {
rv = i2c_smbus_write_byte(client,init_common[i]);
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;
}
}
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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);
......
......@@ -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)",
};
/*
......
......@@ -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)
......
......@@ -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)
......
......@@ -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);
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -197,9 +197,7 @@ static struct i2c_client client_template =
{
.id = -1,
.driver = &i2c_driver_tuner,
.dev = {
.name = "SAB3036",
},
.name = "SAB3036",
};
int __init
......
......@@ -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)
......
......@@ -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)
......
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