mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 10:30:54 +07:00
i2c-pxa: Support new-style I2C drivers
Signed-off-by: Rodolfo Giometti <giometti@linux.it> Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
parent
4d6ceed442
commit
066af983c7
@ -921,7 +921,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
|
||||
i2c->adap.class = plat->class;
|
||||
}
|
||||
|
||||
ret = i2c_add_adapter(&i2c->adap);
|
||||
/*
|
||||
* If "dev->id" is negative we consider it as zero.
|
||||
* The reason to do so is to avoid sysfs names that only make
|
||||
* sense when there are multiple adapters.
|
||||
*/
|
||||
i2c->adap.nr = dev->id >= 0 ? dev->id : 0;
|
||||
|
||||
ret = i2c_add_numbered_adapter(&i2c->adap);
|
||||
if (ret < 0) {
|
||||
printk(KERN_INFO "I2C: Failed to add bus\n");
|
||||
goto eadapt;
|
||||
|
Loading…
Reference in New Issue
Block a user