From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>,
Dan Williams <dan.j.williams@intel.com>,
Vinod Koul <vinod.koul@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
dmaengine@vger.kernel.org, Grant Likely <grant.likely@linaro.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Michal Simek <michal.simek@xilinx.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Randy Dunlap <rdunlap@infradead.org>,
Alan Stern <stern@rowland.harvard.edu>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Kyungmin Park <kyungmin.park@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH v6 2/4] amba: Add helper macros for (un)preparing AMBA clock
Date: Tue, 23 Sep 2014 09:30:36 +0200 [thread overview]
Message-ID: <1411457436.8863.3.camel@AMDC1943> (raw)
In-Reply-To: <CAPDyKFpADBgR90_4s6Dxa8GSQ3F2kQFf6Az-J85D_1ZVD6=A5A@mail.gmail.com>
On pon, 2014-09-22 at 20:56 +0200, Ulf Hansson wrote:
> On 22 September 2014 11:46, Krzysztof Kozlowski <k.kozlowski@samsung.com> wrote:
> > Add amba_pclk_prepare() and amba_pclk_unprepare() macros for handling
> > the AMBA bus clock by device drivers.
> >
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> > ---
> > include/linux/amba/bus.h | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
> > index fdd7e1b61f60..ad52027a9cbf 100644
> > --- a/include/linux/amba/bus.h
> > +++ b/include/linux/amba/bus.h
> > @@ -92,6 +92,12 @@ void amba_release_regions(struct amba_device *);
> > #define amba_pclk_disable(d) \
> > do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0)
> >
> > +#define amba_pclk_prepare(d) \
> > + (IS_ERR((d)->pclk) ? 0 : clk_prepare((d)->pclk))
>
> You don't need the IS_ERR, because amba_probe will fail if it won't be
> able to fetch the clock.
>
> Same comment below.
Right, I followed the convention for amba_pclk_enable but this is not
needed. I'll change it and send new version.
Best regards,
Krzysztof
>
> Kind regards
> Uffe
>
> > +
> > +#define amba_pclk_unprepare(d) \
> > + do { if (!IS_ERR((d)->pclk)) clk_unprepare((d)->pclk); } while (0)
> > +
> > /* Some drivers don't use the struct amba_device */
> > #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff)
> > #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f)
> > --
> > 1.9.1
> >
next prev parent reply other threads:[~2014-09-23 7:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-22 9:46 [PATCH v6 0/4] amba/dma: pl330: add Power Management support Krzysztof Kozlowski
2014-09-22 9:46 ` [PATCH v6 1/4] PM / Runtime: Add getter for quering the IRQ safe option Krzysztof Kozlowski
2014-09-22 9:46 ` [PATCH v6 2/4] amba: Add helper macros for (un)preparing AMBA clock Krzysztof Kozlowski
2014-09-22 18:56 ` Ulf Hansson
2014-09-23 7:30 ` Krzysztof Kozlowski [this message]
2014-09-22 9:46 ` [PATCH v6 3/4] amba: Don't unprepare the clocks if device driver wants IRQ safe runtime PM Krzysztof Kozlowski
2014-09-22 9:46 ` [PATCH v6 4/4] dma: pl330: add Power Management support Krzysztof Kozlowski
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=1411457436.8863.3.camel@AMDC1943 \
--to=k.kozlowski@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=kyungmin.park@samsung.com \
--cc=lars@metafoo.de \
--cc=len.brown@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=m.szyprowski@samsung.com \
--cc=michal.simek@xilinx.com \
--cc=pavel@ucw.cz \
--cc=rdunlap@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=stern@rowland.harvard.edu \
--cc=ulf.hansson@linaro.org \
--cc=vinod.koul@intel.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;
as well as URLs for NNTP newsgroup(s).