From: Bill Gatliff <bgat@billgatliff.com>
To: linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org
Cc: Bill Gatliff <bgat@billgatliff.com>
Subject: Re: [PWM v8 1/3] PWM: Implement a generic PWM framework
Date: Mon, 14 Mar 2011 09:29:00 -0500 [thread overview]
Message-ID: <AANLkTim9XhrHjQy8EmGAez6DV8e-aASDHUQOyf=cjvdM@mail.gmail.com> (raw)
In-Reply-To: <1299990249-18264-2-git-send-email-bgat@billgatliff.com>
Guys:
On Sat, Mar 12, 2011 at 10:24 PM, Bill Gatliff <bgat@billgatliff.com> wrote:
> +static ssize_t pwm_duty_ns_show(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct pwm_device *p = to_pwm_device(dev);
> + return sprintf(buf, "%lu\n", pwm_get_duty_ns(p));
> +}
What would happen if device_unregister() was called on the above
device while duty_ns_show() was running?
My hope is that the device_unregister() would decrement the usage
count on the device, but the count would still be nonzero due to the
running attribute method; thus, the device would not be deleted. When
the method exited, the usage count would become zero and THEN the
device would disappear. Is that how things work? (I have looked at
the code for device_unregister() and friends, but haven't yet been
able to answer this question for myself; said code seems nontrivial).
b.g.
--
Bill Gatliff
bgat@billgatliff.com
next prev parent reply other threads:[~2011-03-14 14:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-13 4:24 [PWM v8 0/3] Implement a generic PWM framework Bill Gatliff
2011-03-13 4:24 ` [PWM v8 1/3] PWM: " Bill Gatliff
2011-03-14 14:29 ` Bill Gatliff [this message]
2011-03-17 7:59 ` Lars-Peter Clausen
2011-03-30 23:57 ` Mike Frysinger
2011-03-31 0:33 ` Bill Gatliff
2011-03-31 0:36 ` Mike Frysinger
2011-03-31 0:38 ` Mike Frysinger
2011-03-31 2:36 ` Chris Ball
2011-03-31 0:43 ` Bill Gatliff
2011-03-31 0:49 ` Mike Frysinger
2011-04-02 23:09 ` Bill Gatliff
2011-03-13 4:24 ` [PWM v8 2/3] PWM: GPIO+hrtimer device emulation Bill Gatliff
2011-03-13 4:24 ` [PWM v8 3/3] PWM: Atmel PWMC driver Bill Gatliff
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='AANLkTim9XhrHjQy8EmGAez6DV8e-aASDHUQOyf=cjvdM@mail.gmail.com' \
--to=bgat@billgatliff.com \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).