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

Re: [PATCH v5 05/16] pwm: Add device tree support

From: Thierry Reding <hidden>
Date: 2012-03-30 06:24:26
Also in: linux-arm-kernel, linux-tegra

* Mark Brown wrote:
On Wed, Mar 28, 2012 at 04:33:47PM +0200, Thierry Reding wrote:
quoted
+	pwm = pwm_request_from_chip(pc, args->args[0], NULL);
+	if (IS_ERR(pwm))
+		return ERR_PTR(-ENODEV);
It feels wrong to override the error code like this rather than passing
the error we got back to the caller.  Is there any great reason for
doing so?
Yes, this certainly looks wrong. I must have forgotten to fix this up when
of_pwm_simple_xlate() was converted to return a struct pwm_device instead of
an int. Previous to that pwm_request_from_chip() would return NULL and
-ENODEV seemed like the proper error code for that situation.

I'll change this to just return pwm.

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