mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: pHilipp Zabel <philipp.zabel@gmail.com>
To: Samuel Ortiz <sameo@openedhand.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/7] MFD: ASIC3: add clock handling for MFD cells
Date: Fri, 5 Jun 2009 18:27:20 +0200	[thread overview]
Message-ID: <74d0deb30906050927i428f732ehc76ac592c87d44b3@mail.gmail.com> (raw)
In-Reply-To: <20090604234911.GC5460@sortiz.org>

On Fri, Jun 5, 2009 at 1:49 AM, Samuel Ortiz<sameo@openedhand.com> wrote:
> Hi Philipp,
>
> On Thu, Jun 04, 2009 at 08:36:11PM +0200, Philipp Zabel wrote:
>> +
>> +struct asic3_clk {
>> +     int enabled;
> You probably want to use a kref here.
>
>> +static int asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk)
>> +{
>> +     unsigned long flags;
>> +     u32 cdex;
>> +
>> +     spin_lock_irqsave(&asic->lock, flags);
>> +     if (clk->enabled++ == 0) {
> using the kref API here would definitely be nicer.

While I agree that the kref API looks nice, I'm not convinced it is
intended to be used in this case. We are not counting references here.
There is no way to get the count back from the API, which we need to
decide whether or not to flip the CDEX bits. We could misuse the
release function pointer given to kref_put to turn off the clock, but
I'd prefer to leave it the way it is now.

regards
Philipp

  reply	other threads:[~2009-06-05 16:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 18:36 [PATCH 0/7] ASIC3 updates Philipp Zabel
2009-06-04 18:36 ` [PATCH 1/7] MFD: ASIC3: add API for EXTCF and SDHWCTRL register manipulation Philipp Zabel
2009-06-04 23:46   ` Samuel Ortiz
2009-06-05 16:25     ` pHilipp Zabel
2009-06-04 18:36 ` [PATCH 2/7] MFD: ASIC3: add clock handling for MFD cells Philipp Zabel
2009-06-04 23:49   ` Samuel Ortiz
2009-06-05 16:27     ` pHilipp Zabel [this message]
2009-06-05 16:58       ` Samuel Ortiz
2009-06-04 18:36 ` [PATCH 3/7] MFD: ASIC3: add ASIC3 IRQ numbers Philipp Zabel
2009-06-04 18:36 ` [PATCH 4/7] MFD: ASIC3: use resource_size macro instead of local variable Philipp Zabel
2009-06-04 18:36 ` [PATCH 5/7] MFD: ASIC3: remove SD/SDIO controller register definitions Philipp Zabel
2009-06-04 18:36 ` [PATCH 6/7] MFD: ASIC3: enable DS1WM cell Philipp Zabel
2009-06-04 18:36 ` [PATCH 7/7] MFD: ASIC3: enable SD/SDIO cell Philipp Zabel
2009-06-05 16:31 [PATCH 0/7] ASIC3 updates (v2) Philipp Zabel
2009-06-05 16:31 ` [PATCH 2/7] MFD: ASIC3: add clock handling for MFD cells Philipp Zabel

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=74d0deb30906050927i428f732ehc76ac592c87d44b3@mail.gmail.com \
    --to=philipp.zabel@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@openedhand.com \
    /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

all inboxes | Powered by JetHome®