Backport from Linux 2.6:

Clean up name string usage in 11 i2c bus drivers:
* Use the pci_driver name for requesting the I/O region rather than
  redefining a new string.
* Do not initialize the i2c_adapter name to "unset".
This should save a few data bytes here and there.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3149 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2005-10-30 10:02:58 +00:00
1 parent 8d04d78a29
commit 7f68d835a3
11 files changed
+27 -20

No files matched your search

+2 -2
View File
@@ -138,6 +138,7 @@
#define ALI1535_SMBIO_EN 0x04 /* SMB I/O Space enable */
static struct pci_driver ali1535_driver;
static unsigned short ali1535_smba = 0;
DECLARE_MUTEX(i2c_ali1535_sem);
@@ -201,7 +202,7 @@ int ali1535_setup(struct pci_dev *ALI1535_dev)
pci_write_config_byte(ALI1535_dev, SMBCLK, 0x20);
/* Everything is happy, let's grab the memory and set things up. */
request_region(ali1535_smba, ALI1535_SMB_IOSIZE, "ali1535-smb");
request_region(ali1535_smba, ALI1535_SMB_IOSIZE, ali1535_driver.name);
#ifdef DEBUG
/*
@@ -468,7 +469,6 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter ali1535_adapter = {
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI1535,
.algo = &smbus_algorithm,
.inc_use = ali1535_inc,
+4 -3
View File
@@ -66,6 +66,7 @@
#define HST_CNTL2_BLOCK 0x05
#define HST_CNTL2_SIZEMASK 0x38
static struct pci_driver ali1563_pci_driver;
static unsigned short ali1563_smba;
static int ali1563_transaction(struct i2c_adapter * a)
@@ -362,7 +363,8 @@ static int __devinit ali1563_setup(struct pci_dev * dev)
printk(KERN_WARNING "ali1563: ali1563_smba Uninitialized\n");
goto Err;
}
if (!request_region(ali1563_smba,ALI1563_SMB_IOSIZE,"i2c-ali1563")) {
if (!request_region(ali1563_smba, ALI1563_SMB_IOSIZE,
ali1563_pci_driver.name)) {
printk(KERN_WARNING "ali1563: Could not allocate I/O space");
goto Err;
}
@@ -399,7 +401,6 @@ static struct i2c_algorithm ali1563_algorithm = {
};
static struct i2c_adapter ali1563_adapter = {
.name = "unset",
.algo = &ali1563_algorithm,
.inc_use = ali1563_inc,
.dec_use = ali1563_dec,
@@ -438,7 +439,7 @@ static struct pci_device_id ali1563_ids[] __devinitdata = {
};
static struct pci_driver ali1563_pci_driver = {
.name = "ali1563 driver",
.name = "ali1563 smbus",
.id_table = ali1563_ids,
.probe = ali1563_probe,
.remove = __devexit_p(ali1563_remove),
+3 -2
View File
@@ -133,6 +133,7 @@ MODULE_PARM(force_addr, "i");
MODULE_PARM_DESC(force_addr,
"Initialize the base address of the i2c controller");
static struct pci_driver ali15x3_driver;
static unsigned short ali15x3_smba = 0;
static int ali15x3_setup(struct pci_dev *ALI15X3_dev)
@@ -169,7 +170,8 @@ static int ali15x3_setup(struct pci_dev *ALI15X3_dev)
if(force_addr)
ali15x3_smba = force_addr & ~(ALI15X3_SMB_IOSIZE - 1);
if (!request_region(ali15x3_smba, ALI15X3_SMB_IOSIZE, "ali15x3-smb")) {
if (!request_region(ali15x3_smba, ALI15X3_SMB_IOSIZE,
ali15x3_driver.name)) {
dev_err(ALI15X3_dev,
"ALI15X3_smb region 0x%x already in use!\n",
ali15x3_smba);
@@ -485,7 +487,6 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter ali15x3_adapter = {
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI15X3,
.algo = &smbus_algorithm,
.name = "unset",
.inc_use = ali15x3_inc,
.dec_use = ali15x3_dec,
};
-1
View File
@@ -323,7 +323,6 @@ static struct i2c_algorithm smbus_algorithm = {
};
struct i2c_adapter amd756_smbus = {
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD756,
.algo = &smbus_algorithm,
.inc_use = amd756_inc,
+3 -1
View File
@@ -37,6 +37,8 @@ struct amd_smbus {
int size;
};
static struct pci_driver amd8111_driver;
/*
* AMD PCI control registers definitions.
*/
@@ -371,7 +373,7 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_
smbus->base = pci_resource_start(dev, 0);
smbus->size = pci_resource_len(dev, 0);
if (!request_region(smbus->base, smbus->size, "amd8111 SMBus 2.0")) {
if (!request_region(smbus->base, smbus->size, amd8111_driver.name)) {
kfree(smbus);
return -1;
}
+2 -2
View File
@@ -149,6 +149,7 @@ static int i801_block_transaction(union i2c_smbus_data *data,
char read_write, int command);
static unsigned short i801_smba;
static struct pci_driver i801_driver;
static struct pci_dev *I801_dev;
static int isich4; /* is PEC supported? */
static int isich5; /* is i2c block read supported? */
@@ -187,7 +188,7 @@ static int i801_setup(struct pci_dev *dev)
}
}
if (!request_region(i801_smba, (isich4 ? 16 : 8), "i801-smbus")) {
if (!request_region(i801_smba, (isich4 ? 16 : 8), i801_driver.name)) {
dev_err(dev, "I801_smb region 0x%x already in use!\n",
i801_smba);
error_return = -EBUSY;
@@ -615,7 +616,6 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter i801_adapter = {
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_I801,
.algo = &smbus_algorithm,
.name = "unset",
.inc_use = i801_inc,
.dec_use = i801_dec,
};
+2 -1
View File
@@ -118,6 +118,7 @@ struct nforce2_smbus {
#define NVIDIA_SMB_PRTCL_I2C_BLOCK_DATA 0x4a
#define NVIDIA_SMB_PRTCL_PEC 0x80
static struct pci_driver nforce2_driver;
static s32 nforce2_access(struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write,
@@ -319,7 +320,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int reg, struct nfo
smbus->base = iobase & 0xfffc;
smbus->size = 8;
if (!request_region(smbus->base, smbus->size, "nForce2 SMBus")) {
if (!request_region(smbus->base, smbus->size, nforce2_driver.name)) {
printk (KERN_ERR "i2c-nforce2.o: Error requesting region %02x .. %02X for %s\n", smbus->base, smbus->base+smbus->size-1, name);
return -1;
}
+2 -2
View File
@@ -110,6 +110,7 @@ MODULE_PARM_DESC(fix_hstcfg,
static int piix4_transaction(void);
static unsigned short piix4_smba = 0;
static struct pci_driver piix4_driver;
#ifdef CONFIG_X86
/*
@@ -162,7 +163,7 @@ static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
}
}
if (!request_region(piix4_smba, SMBIOSIZE, "piix4-smbus")) {
if (!request_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) {
printk(KERN_ERR "i2c-piix4.o: SMB region 0x%x already in "
"use!\n", piix4_smba);
return -ENODEV;
@@ -448,7 +449,6 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter piix4_adapter = {
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_PIIX4,
.algo = &smbus_algorithm,
.inc_use = piix4_inc,
+2 -2
View File
@@ -134,6 +134,7 @@ MODULE_PARM_DESC(force_addr,
static int sis5595_transaction(void);
static struct pci_driver sis5595_driver;
static unsigned short sis5595_base = 0;
static u8 sis5595_read(u8 reg)
@@ -223,7 +224,7 @@ int sis5595_setup(struct pci_dev *SIS5595_dev)
}
/* Everything is happy, let's grab the memory and set things up. */
request_region(sis5595_base + SMB_INDEX, 2, "sis5595-smbus");
request_region(sis5595_base + SMB_INDEX, 2, sis5595_driver.name);
return(0);
}
@@ -425,7 +426,6 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter sis5595_adapter = {
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_SIS5595,
.algo = &smbus_algorithm,
.inc_use = sis5595_inc,
+4 -2
View File
@@ -102,6 +102,8 @@
#define SIS630_PCALL 0x04
#define SIS630_BLOCK_DATA 0x05
static struct pci_driver sis630_driver;
/* insmod parameters */
static int high_clock = 0;
static int force = 0;
@@ -451,7 +453,8 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev) {
DBG("ACPI base at 0x%04x\n", acpi_base);
/* Everything is happy, let's grab the memory and set things up. */
if (!request_region(acpi_base + SMB_STS, SIS630_SMB_IOREGION, "sis630-smbus")){
if (!request_region(acpi_base + SMB_STS, SIS630_SMB_IOREGION,
sis630_driver.name)){
printk(KERN_ERR "i2c-sis630.o: SMBus registers 0x%04x-0x%04x "
"already in use!\n",acpi_base + SMB_STS, acpi_base + SMB_SAA);
acpi_base = 0; /* reset acpi_base */
@@ -470,7 +473,6 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter sis630_adapter = {
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_SIS630,
.algo = &smbus_algorithm,
.inc_use = sis630_inc,
+3 -2
View File
@@ -142,6 +142,7 @@
#define SIS645_PROC_CALL 0x04
#define SIS645_BLOCK_DATA 0x05
static struct pci_driver sis645_driver;
static struct i2c_adapter sis645_adapter;
static u16 sis645_smbus_base = 0;
@@ -488,7 +489,6 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter sis645_adapter = {
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_SIS645,
.algo = &smbus_algorithm,
.inc_use = sis645_inc,
@@ -532,7 +532,8 @@ static int __devinit sis645_probe(struct pci_dev *dev,
sis645_smbus_base);
/* Everything is happy, let's grab the memory and set things up. */
if (!request_region(sis645_smbus_base, SMB_IOSIZE, "sis645-smbus")) {
if (!request_region(sis645_smbus_base, SMB_IOSIZE,
sis645_driver.name)) {
dev_err(dev, "SMBus registers 0x%04x-0x%04x "
"already in use!\n", sis645_smbus_base,
sis645_smbus_base + SMB_IOSIZE - 1);