summaryrefslogtreecommitdiffstats
path: root/drivers/sbus/char/bbc_i2c.c
diff options
context:
space:
mode:
authorChristopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>2014-08-03 15:44:52 +0200
committerDavid S. Miller <davem@davemloft.net>2014-08-04 16:53:43 -0700
commit5cdceab3d5e02eb69ea0f5d8fa9181800baf6f77 (patch)
tree26ab04f2c46e8d7bd09bc8ed64523e22f6c5d9fa /drivers/sbus/char/bbc_i2c.c
parent18f38132528c3e603c66ea464727b29e9bbcb91b (diff)
downloadlinux-5cdceab3d5e02eb69ea0f5d8fa9181800baf6f77.tar.bz2
bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000
Fix regression in bbc i2c temperature and fan control on some Sun systems that causes the driver to refuse to load due to the bbc_i2c_bussel resource not being present on the (second) i2c bus where the temperature sensors and fan control are located. (The check for the number of resources was removed when the driver was ported to a pure OF driver in mid 2008.) Signed-off-by: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/sbus/char/bbc_i2c.c')
-rw-r--r--drivers/sbus/char/bbc_i2c.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c
index c7763e482eb2..812b5f0361b6 100644
--- a/drivers/sbus/char/bbc_i2c.c
+++ b/drivers/sbus/char/bbc_i2c.c
@@ -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);