Commit 7554c49e authored by Christopher Alexander Tobias Schulze's avatar Christopher Alexander Tobias Schulze Committed by Greg Kroah-Hartman

bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000

[ Upstream commit 5cdceab3 ]

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: default avatarChristopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d7bcdfe0
...@@ -452,6 +452,9 @@ static void attach_one_temp(struct bbc_i2c_bus *bp, struct platform_device *op, ...@@ -452,6 +452,9 @@ static void attach_one_temp(struct bbc_i2c_bus *bp, struct platform_device *op,
if (!tp) if (!tp)
return; return;
INIT_LIST_HEAD(&tp->bp_list);
INIT_LIST_HEAD(&tp->glob_list);
tp->client = bbc_i2c_attach(bp, op); tp->client = bbc_i2c_attach(bp, op);
if (!tp->client) { if (!tp->client) {
kfree(tp); kfree(tp);
...@@ -497,6 +500,9 @@ static void attach_one_fan(struct bbc_i2c_bus *bp, struct platform_device *op, ...@@ -497,6 +500,9 @@ static void attach_one_fan(struct bbc_i2c_bus *bp, struct platform_device *op,
if (!fp) if (!fp)
return; return;
INIT_LIST_HEAD(&fp->bp_list);
INIT_LIST_HEAD(&fp->glob_list);
fp->client = bbc_i2c_attach(bp, op); fp->client = bbc_i2c_attach(bp, op);
if (!fp->client) { if (!fp->client) {
kfree(fp); kfree(fp);
......
...@@ -301,13 +301,18 @@ static struct bbc_i2c_bus * __init attach_one_i2c(struct platform_device *op, in ...@@ -301,13 +301,18 @@ static struct bbc_i2c_bus * __init attach_one_i2c(struct platform_device *op, in
if (!bp) if (!bp)
return NULL; 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"); bp->i2c_control_regs = of_ioremap(&op->resource[0], 0, 0x2, "bbc_i2c_regs");
if (!bp->i2c_control_regs) if (!bp->i2c_control_regs)
goto fail; goto fail;
bp->i2c_bussel_reg = of_ioremap(&op->resource[1], 0, 0x1, "bbc_i2c_bussel"); if (op->num_resources == 2) {
if (!bp->i2c_bussel_reg) bp->i2c_bussel_reg = of_ioremap(&op->resource[1], 0, 0x1, "bbc_i2c_bussel");
goto fail; if (!bp->i2c_bussel_reg)
goto fail;
}
bp->waiting = 0; bp->waiting = 0;
init_waitqueue_head(&bp->wq); init_waitqueue_head(&bp->wq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment