diff mbox

pwm: Fix compile error in pwm_get()

Message ID 20170210114430.21512-1-hdegoede@redhat.com
State Accepted
Headers show

Commit Message

Hans de Goede Feb. 10, 2017, 11:44 a.m. UTC
commit bf71f4e8fb95 ("pwm: Try to load modules during pwm_get()") had
error checking added to the request_module call it adds, before merging
it. But the "err" variable the error checking uses was never declared,
this commit fixes this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Feel free to squash this into the original commit
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thierry Reding Feb. 10, 2017, 2:23 p.m. UTC | #1
On Fri, Feb 10, 2017 at 12:44:30PM +0100, Hans de Goede wrote:
> commit bf71f4e8fb95 ("pwm: Try to load modules during pwm_get()") had
> error checking added to the request_module call it adds, before merging
> it. But the "err" variable the error checking uses was never declared,
> this commit fixes this.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Feel free to squash this into the original commit
> ---
>  drivers/pwm/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

You had me really confused there for a little bit. Turns out I had two
versions of that patch in my tree, one with the missing variable
declaration and another where I had already added it after build tests
had failed. The old patch stuck around because it was part of a branch
that I had created in case anyone wanted to pull this into the ACPI
tree to resolve dependencies and I had forgotten to rebase that branch
onto the fixed patch.

I've pushed a new set of branches, so this confusion should be gone by
tomorrow. It's a little odd that you even saw this failing to build,
since none of the farms seemed to have noticed, and the file in
linux-next is actually the correct one.

Thierry
diff mbox

Patch

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 50a33ca..4f3c0a1 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -831,7 +831,7 @@  struct pwm_device *pwm_get(struct device *dev, const char *con_id)
 	 * deferred probe mechanism.
 	 */
 	if (!chip && chosen->module) {
-		err = request_module(chosen->module);
+		int err = request_module(chosen->module);
 		if (err == 0)
 			chip = pwmchip_find_by_name(chosen->provider);
 	}