From: b32955@freescale.com (Huang Shijie)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 1/3] MTD : add the common code for GPMI controller driver
Date: Fri, 29 Apr 2011 09:42:20 +0800 [thread overview]
Message-ID: <4DBA177C.50805@freescale.com> (raw)
In-Reply-To: <20110428192017.GO17290@n2100.arm.linux.org.uk>
hi:
> On Wed, Apr 20, 2011 at 10:45:47AM +0800, Huang Shijie wrote:
>> +static inline int acquire_clock(struct gpmi_nfc_data *this, struct clk **clock)
>> +{
>> + struct clk *c;
>> +
>> + c = clk_get(&this->pdev->dev, NULL);
>> + if (IS_ERR(c)) {
>> + log("Can't own clock");
>> + return PTR_ERR(c);
>> + }
>> + *clock = c;
>> + return 0;
>> +}
>> +
>> +static void release_clock(struct gpmi_nfc_data *this, struct clk *clock)
>> +{
>> + clk_put(clock);
>> +}
> Do you really need to abstract like this? It appears to just complicate
> the code unnecessarily.
>
ok, I can remove the two functions.
>> +#define log(a, ...) printk(KERN_INFO "[ %s : %.3d ] "a"\n", \
>> + __func__, __LINE__, ## __VA_ARGS__)
> Also, I don't like this log() function. You can do the same with:
>
> #define pr_fmt(fmt) "[ %s : %.3d ] " fmt, __func__, __LINE__
>
> and use pr_info() instead. Note that it's generally frowned upon to
> hide the \n inside the pr_fmt().
>
ok, I will change it.
Thanks .
Best Regards
Huang Shijie
next prev parent reply other threads:[~2011-04-29 1:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-20 2:45 [PATCH v6 0/3] add the GPMI controller driver for IMX23/IMX28 Huang Shijie
2011-04-20 2:45 ` [PATCH v6 1/3] MTD : add the common code for GPMI controller driver Huang Shijie
2011-04-21 7:49 ` Lothar Waßmann
2011-04-22 9:39 ` Huang Shijie
2011-04-26 2:52 ` Huang Shijie
2011-04-26 10:09 ` Lothar Waßmann
2011-04-28 19:20 ` Russell King - ARM Linux
2011-04-29 1:42 ` Huang Shijie [this message]
2011-04-20 2:45 ` [PATCH v6 2/3] MTD : add support for imx23 and imx28 Huang Shijie
2011-04-20 2:45 ` [PATCH v6 3/3] MTD : add GPMI driver in the config and Makefile Huang Shijie
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=4DBA177C.50805@freescale.com \
--to=b32955@freescale.com \
--cc=linux-arm-kernel@lists.infradead.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).