Thread (1 message) 1 message, 1 author, 2012-03-20

[PATCH v4 03/10] pwm: Add device tree support

From: Thierry Reding <hidden>
Date: 2012-03-20 05:51:22
Also in: linux-devicetree, linux-tegra

Possibly related (same subject, not in this thread)

* Stephen Warren wrote:
On 03/14/2012 09:56 AM, Thierry Reding wrote:
quoted
This patch adds helpers to support device tree bindings for the generic
PWM API. Device tree binding documentation for PWM controllers is also
provided.
...
quoted
+static struct pwm_device *of_pwm_simple_xlate(struct pwm_chip *pc,
+					      const struct of_phandle_args *args)
...
quoted
+	if (args->args_count < pc->of_pwm_n_cells)
+		return ERR_PTR(-EINVAL);
I think you can drop that error-check given the code quoted below?

(and if not, shouldn't it be != not >= ?)
quoted
+struct pwm_device *of_pwm_request(struct device_node *np,
+				  const char *propname, int index)
...
quoted
+	if (args.args_count != pc->of_pwm_n_cells) {
+		pr_debug("%s: wrong #pwm-cells for %s\n", np->full_name,
+			 args.np->full_name);
+		pwm = ERR_PTR(-EINVAL);
+		goto put;
+	}
+
+	pwm = pc->of_xlate(pc, &args);
Yes, you're right. It is completely redundant.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120320/657e8c0e/attachment.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help