|
@@ -300,13 +300,18 @@ static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index
|
|
|
if (!bp)
|
|
|
return NULL;
|
|
|
|
|
|
+ INIT_LIST_HEAD(&bp->temps);
|
|
|
+ INIT_LIST_HEAD(&bp->fans);
|
|
|
+
|
|
|
bp->i2c_control_regs = of_ioremap(&op->resource[0], 0, 0x2, "bbc_i2c_regs");
|
|
|
if (!bp->i2c_control_regs)
|
|
|
goto fail;
|
|
|
|
|
|
- bp->i2c_bussel_reg = of_ioremap(&op->resource[1], 0, 0x1, "bbc_i2c_bussel");
|
|
|
- if (!bp->i2c_bussel_reg)
|
|
|
- goto fail;
|
|
|
+ if (op->num_resources == 2) {
|
|
|
+ bp->i2c_bussel_reg = of_ioremap(&op->resource[1], 0, 0x1, "bbc_i2c_bussel");
|
|
|
+ if (!bp->i2c_bussel_reg)
|
|
|
+ goto fail;
|
|
|
+ }
|
|
|
|
|
|
bp->waiting = 0;
|
|
|
init_waitqueue_head(&bp->wq);
|