Thread (3 messages) 3 messages, 3 authors, 2017-01-03

[PATCH v3 1/3] power: reset: add linkstation-reset driver

From: andrew@lunn.ch (Andrew Lunn)
Date: 2017-01-03 13:09:16
Also in: linux-devicetree, linux-pm

quoted
+
+	/* Check that nothing else has already setup a handler */
+	if (pm_power_off) {
+		lookup_symbol_name((ulong)pm_power_off, symname);
+		dev_err(&pdev->dev,
+			"pm_power_off already claimed %p %s",
+			pm_power_off, symname);
+		return -EBUSY;
+	}
+	pm_power_off = linkstation_reset;
That seems a bit complicated, why not just assume that there will be
either this driver used, or not at all?
That is probably my fault. This is a copy from code i wrote many years
ago for the QNAP. I guess at the time i was battling with two
different pm_power_off handlers, so put in this code.
Also, you are supposed to register a reboot notifier to which you can
pass private context:
At the time i wrote the QNAP code, this did not exist. So maybe my
code is no longer a good example to copy.

	 Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help