public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Kim, Milo" <Milo.Kim@ti.com>
Cc: Bryan Wu <bryan.wu@canonical.com>,
	"thierry.reding@avionic-design.de"
	<thierry.reding@avionic-design.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] leds-lm3530: replace pwm platform functions with generic pwm functions
Date: Mon, 20 Aug 2012 06:45:37 +0000	[thread overview]
Message-ID: <201208200645.38047.arnd@arndb.de> (raw)
In-Reply-To: <A874F61F95741C4A9BA573A70FE3998F41EF092A@DQHE02.ent.ti.com>

On Monday 20 August 2012, Kim, Milo wrote:
> > * I don't understand why you need the "if (rvdata->pwm) return 0;" case.
> >   It's normally better to do the initialization exactly once from the
> >   probe() function. You might want to return -EPROBE_DEFER if the pwm
> >   source is not yet available though.
> 
> This device has 3 control mode. - register access, sensor input and PWM input.
> One of modes can be selected on-the-fly.
> So that's why I add code which returning 0 when PWM device exists.
> Whenever mode change occurs from/to 'PWM input', pwm_request() and pwm_free() should be called.

In that case, I would recommend changing it from

+       /* if the pwm device exists, skip requesting the device */
+       if (drvdata->pwm)
+               return 0;

to 

	/* warn if the PWM was not released prior to reneabling it */
	WARN_ON(drvdata->pwm);


	Arnd

  reply	other threads:[~2012-08-20  6:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-20  4:02 [PATCH] leds-lm3530: replace pwm platform functions with generic pwm functions Kim, Milo
2012-08-20  5:04 ` Thierry Reding
2012-08-20  5:06 ` Thierry Reding
2012-08-20  5:37 ` Arnd Bergmann
2012-08-20  5:58   ` Thierry Reding
2012-08-20  6:16     ` Kim, Milo
2012-08-20  7:31       ` Thierry Reding
2012-08-20  7:41         ` Kim, Milo
2012-08-20  7:50           ` Thierry Reding
2012-08-20  7:56             ` Kim, Milo
2012-08-20  6:13   ` Kim, Milo
2012-08-20  6:45     ` Arnd Bergmann [this message]
2012-08-20  7:26       ` Kim, Milo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201208200645.38047.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=Milo.Kim@ti.com \
    --cc=bryan.wu@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@avionic-design.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox