diff options
author | Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net> | 2014-08-03 09:44:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-04 19:53:43 -0400 |
commit | 5cdceab3d5e02eb69ea0f5d8fa9181800baf6f77 (patch) | |
tree | 26ab04f2c46e8d7bd09bc8ed64523e22f6c5d9fa /drivers/sbus/char | |
parent | 18f38132528c3e603c66ea464727b29e9bbcb91b (diff) |
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')
-rw-r--r-- | drivers/sbus/char/bbc_envctrl.c | 6 | ||||
-rw-r--r-- | drivers/sbus/char/bbc_i2c.c | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c index 160e7510aca6..0787b9756165 100644 --- a/drivers/sbus/char/bbc_envctrl.c +++ b/drivers/sbus/char/bbc_envctrl.c | |||
@@ -452,6 +452,9 @@ static void attach_one_temp(struct bbc_i2c_bus *bp, struct platform_device *op, | |||
452 | if (!tp) | 452 | if (!tp) |
453 | return; | 453 | return; |
454 | 454 | ||
455 | INIT_LIST_HEAD(&tp->bp_list); | ||
456 | INIT_LIST_HEAD(&tp->glob_list); | ||
457 | |||
455 | tp->client = bbc_i2c_attach(bp, op); | 458 | tp->client = bbc_i2c_attach(bp, op); |
456 | if (!tp->client) { | 459 | if (!tp->client) { |
457 | kfree(tp); | 460 | kfree(tp); |
@@ -497,6 +500,9 @@ static void attach_one_fan(struct bbc_i2c_bus *bp, struct platform_device *op, | |||
497 | if (!fp) | 500 | if (!fp) |
498 | return; | 501 | return; |
499 | 502 | ||
503 | INIT_LIST_HEAD(&fp->bp_list); | ||
504 | INIT_LIST_HEAD(&fp->glob_list); | ||
505 | |||
500 | fp->client = bbc_i2c_attach(bp, op); | 506 | fp->client = bbc_i2c_attach(bp, op); |
501 | if (!fp->client) { | 507 | if (!fp->client) { |
502 | kfree(fp); | 508 | kfree(fp); |
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 | |||
300 | if (!bp) | 300 | if (!bp) |
301 | return NULL; | 301 | return NULL; |
302 | 302 | ||
303 | INIT_LIST_HEAD(&bp->temps); | ||
304 | INIT_LIST_HEAD(&bp->fans); | ||
305 | |||
303 | bp->i2c_control_regs = of_ioremap(&op->resource[0], 0, 0x2, "bbc_i2c_regs"); | 306 | bp->i2c_control_regs = of_ioremap(&op->resource[0], 0, 0x2, "bbc_i2c_regs"); |
304 | if (!bp->i2c_control_regs) | 307 | if (!bp->i2c_control_regs) |
305 | goto fail; | 308 | goto fail; |
306 | 309 | ||
307 | bp->i2c_bussel_reg = of_ioremap(&op->resource[1], 0, 0x1, "bbc_i2c_bussel"); | 310 | if (op->num_resources == 2) { |
308 | if (!bp->i2c_bussel_reg) | 311 | bp->i2c_bussel_reg = of_ioremap(&op->resource[1], 0, 0x1, "bbc_i2c_bussel"); |
309 | goto fail; | 312 | if (!bp->i2c_bussel_reg) |
313 | goto fail; | ||
314 | } | ||
310 | 315 | ||
311 | bp->waiting = 0; | 316 | bp->waiting = 0; |
312 | init_waitqueue_head(&bp->wq); | 317 | init_waitqueue_head(&bp->wq); |