All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000
@ 2014-08-03 13:44 Christopher Alexander Tobias Schulze
  2014-08-04 23:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Alexander Tobias Schulze @ 2014-08-03 13:44 UTC (permalink / raw)
  To: sparclinux

From: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>

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.)

Patch applies to 3.16-rc6.

Signed-off-by: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>

---

diff -Naupr linux-3.16-rc6-orig/drivers/sbus/char/bbc_envctrl.c linux-3.16-rc6-patched/drivers/sbus/char/bbc_envctrl.c
--- linux-3.16-rc6-orig/drivers/sbus/char/bbc_envctrl.c	2014-07-27 11:49:21.000000000 +0200
+++ linux-3.16-rc6-patched/drivers/sbus/char/bbc_envctrl.c	2014-08-03 15:21:17.000000000 +0200
@@ -452,6 +452,9 @@ static void attach_one_temp(struct bbc_i
 	if (!tp)
 		return;
 
+	INIT_LIST_HEAD(&tp->bp_list);
+	INIT_LIST_HEAD(&tp->glob_list);
+
 	tp->client = bbc_i2c_attach(bp, op);
 	if (!tp->client) {
 		kfree(tp);
@@ -497,6 +500,9 @@ static void attach_one_fan(struct bbc_i2
 	if (!fp)
 		return;
 
+	INIT_LIST_HEAD(&fp->bp_list);
+	INIT_LIST_HEAD(&fp->glob_list);
+
 	fp->client = bbc_i2c_attach(bp, op);
 	if (!fp->client) {
 		kfree(fp);
diff -Naupr linux-3.16-rc6-orig/drivers/sbus/char/bbc_i2c.c linux-3.16-rc6-patched/drivers/sbus/char/bbc_i2c.c
--- linux-3.16-rc6-orig/drivers/sbus/char/bbc_i2c.c	2014-07-27 11:49:45.000000000 +0200
+++ linux-3.16-rc6-patched/drivers/sbus/char/bbc_i2c.c	2014-08-03 15:21:08.000000000 +0200
@@ -300,13 +300,18 @@ static struct bbc_i2c_bus * attach_one_i
 	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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000
  2014-08-03 13:44 [PATCH] bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000 Christopher Alexander Tobias Schulze
@ 2014-08-04 23:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-08-04 23:54 UTC (permalink / raw)
  To: sparclinux

From: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>
Date: Sun, 3 Aug 2014 15:44:52 +0200

> From: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>
> 
> 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.)
> 
> Patch applies to 3.16-rc6.
> 
> Signed-off-by: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-04 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-03 13:44 [PATCH] bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000 Christopher Alexander Tobias Schulze
2014-08-04 23:54 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.