From: James Hogan <james.hogan@imgtec.com>
To: John Crispin <blogic@openwrt.org>
Cc: Mark Brown <broonie@kernel.org>, Gabor Juhos <juhosg@openwrt.org>,
<linux-spi@vger.kernel.org>, <linux-mips@linux-mips.org>
Subject: Re: [PATCH 2/2] SPI: ralink: add Ralink SoC spi driver
Date: Mon, 12 Aug 2013 17:11:41 +0100 [thread overview]
Message-ID: <5209093D.8060205@imgtec.com> (raw)
In-Reply-To: <520908DD.9040008@imgtec.com>
Sorry, should have read Mark's feedback first :)
James
On 12/08/13 17:10, James Hogan wrote:
> On 09/08/13 19:51, John Crispin wrote:
>> +#ifdef DEBUG
>> +#define spi_debug(args...) printk(args)
>> +#else
>> +#define spi_debug(args...)
>> +#endif
>
> This looks a bit like pr_debug. If you have a device pointer around,
> there's also a dev_dbg which takes an additional device pointer and
> prepends it's name to the message.
>
>> +static int rt2880_spi_probe(struct platform_device *pdev)
>> +{
>
> <snip>
>
>> + clk = devm_clk_get(&pdev->dev, NULL);
>> + if (IS_ERR(clk)) {
>> + dev_err(&pdev->dev, "unable to get SYS clock, err=%d\n",
>> + status);
>> + return PTR_ERR(clk);
>> + }
>
> <snip>
>
>> +}
>> +
>> +static int rt2880_spi_remove(struct platform_device *pdev)
>> +{
>> + struct spi_master *master;
>> + struct rt2880_spi *rs;
>> +
>> + master = dev_get_drvdata(&pdev->dev);
>> + rs = spi_master_get_devdata(master);
>> +
>> + clk_disable(rs->clk);
>> + clk_put(rs->clk);
>
> The devm_clk_get in your probe function means you don't need clk_put here.
>
> Cheers
> James
>
WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@imgtec.com>
To: John Crispin <blogic@openwrt.org>
Cc: Mark Brown <broonie@kernel.org>, Gabor Juhos <juhosg@openwrt.org>,
linux-spi@vger.kernel.org, linux-mips@linux-mips.org
Subject: Re: [PATCH 2/2] SPI: ralink: add Ralink SoC spi driver
Date: Mon, 12 Aug 2013 17:11:41 +0100 [thread overview]
Message-ID: <5209093D.8060205@imgtec.com> (raw)
Message-ID: <20130812161141.JWyyAYmmOreZQhAc8HeQfEPtysu9hg7JYxGIGfTx-jA@z> (raw)
In-Reply-To: <520908DD.9040008@imgtec.com>
Sorry, should have read Mark's feedback first :)
James
On 12/08/13 17:10, James Hogan wrote:
> On 09/08/13 19:51, John Crispin wrote:
>> +#ifdef DEBUG
>> +#define spi_debug(args...) printk(args)
>> +#else
>> +#define spi_debug(args...)
>> +#endif
>
> This looks a bit like pr_debug. If you have a device pointer around,
> there's also a dev_dbg which takes an additional device pointer and
> prepends it's name to the message.
>
>> +static int rt2880_spi_probe(struct platform_device *pdev)
>> +{
>
> <snip>
>
>> + clk = devm_clk_get(&pdev->dev, NULL);
>> + if (IS_ERR(clk)) {
>> + dev_err(&pdev->dev, "unable to get SYS clock, err=%d\n",
>> + status);
>> + return PTR_ERR(clk);
>> + }
>
> <snip>
>
>> +}
>> +
>> +static int rt2880_spi_remove(struct platform_device *pdev)
>> +{
>> + struct spi_master *master;
>> + struct rt2880_spi *rs;
>> +
>> + master = dev_get_drvdata(&pdev->dev);
>> + rs = spi_master_get_devdata(master);
>> +
>> + clk_disable(rs->clk);
>> + clk_put(rs->clk);
>
> The devm_clk_get in your probe function means you don't need clk_put here.
>
> Cheers
> James
>
next prev parent reply other threads:[~2013-08-12 16:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 18:51 [PATCH 1/2] DT: Add documentation for spi-rt2880 John Crispin
2013-08-09 18:51 ` [PATCH 2/2] SPI: ralink: add Ralink SoC spi driver John Crispin
2013-08-11 13:26 ` Mark Brown
2013-08-13 18:43 ` John Crispin
2013-08-13 18:58 ` Mark Brown
2013-08-12 16:10 ` James Hogan
2013-08-12 16:10 ` James Hogan
2013-08-12 16:11 ` James Hogan [this message]
2013-08-12 16:11 ` James Hogan
2013-08-09 20:44 ` [PATCH 1/2] DT: Add documentation for spi-rt2880 Sergei Shtylyov
2013-08-09 23:35 ` Kumar Gala
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=5209093D.8060205@imgtec.com \
--to=james.hogan@imgtec.com \
--cc=blogic@openwrt.org \
--cc=broonie@kernel.org \
--cc=juhosg@openwrt.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-spi@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