From: Stephen Warren <swarren@wwwdotorg.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Laxman Dewangan <ldewangan@nvidia.com>,
linux-tegra@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFT 3/3] ARM: tegra: dts: seaboard: enable keyboard
Date: Fri, 11 Jan 2013 16:39:20 -0700 [thread overview]
Message-ID: <50F0A2A8.3080401@wwwdotorg.org> (raw)
In-Reply-To: <20130111233615.GO23505@n2100.arm.linux.org.uk>
On 01/11/2013 04:36 PM, Russell King - ARM Linux wrote:
> On Fri, Jan 11, 2013 at 04:27:07PM -0700, Stephen Warren wrote:
>> On 01/11/2013 04:24 PM, Russell King - ARM Linux wrote:
>>> On Fri, Jan 11, 2013 at 04:09:59PM -0700, Stephen Warren wrote:
>>>> On 01/11/2013 06:33 AM, Laxman Dewangan wrote:
>>>>> kbc->clk = clk_get(&pdev->dev, NULL);
>>>>> if (IS_ERR(kbc->clk)) {
>>>>> dev_err(&pdev->dev, "failed to get keyboard clock\n");
>>>>> err = PTR_ERR(kbc->clk);
>>>>> goto err_iounmap;
>>>>> }
>>>>
>>>> Should that check be if (!kbc-clk) instead? Or does the common clock
>>>> framework require if (IS_ERR_OR_NULL(kbc->clk)); hopefully not since
>>>> IS_ERR_OR_NULL shouldn't be used any more.
>>>
>>> /**
>>> * clk_get - lookup and obtain a reference to a clock producer.
>>> * @dev: device for clock "consumer"
>>> * @id: clock consumer ID
>>> *
>>> * Returns a struct clk corresponding to the clock producer, or
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> * valid IS_ERR() condition containing errno. ...
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
>>> Or, put another way:
>>>
>>> If (!IS_ERR(clk))
>>> The_Clock_Is_Valid();
>>> Else
>>> The_Clock_Is_Invalid();
>>> The_Error = PTR_ERR(clk);
>>
>> OK, but that doesn't appear to be what happened in practice.
>
> It's what I've been saying each time I see an abuse, the problem is
> people don't care to read the documentation provided let alone
> understand the interfaces.
>
> That's precisely why IS_ERR_OR_NULL() is to be removed. One less
> thing for someone to throw a dart at as a selection method to use.
> Or maybe roll a dice. Or whatever way they do seem to choose.
> (Whatever that is, it's not based on any sound engineering practice
> I can make out.)
For the record, I did mention that IS_ERR_OR_NULL() should not be the
solution here. And the point of my email to Laxman was that he should go
figure out the answer to my question, which would entail reading the
documentation/code/...
next prev parent reply other threads:[~2013-01-11 23:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 13:33 [PATCH 1/3] ARM: DT: tegra: add DT entry for KBC controller Laxman Dewangan
2013-01-11 13:33 ` [PATCH 2/3] ARM: tegra: config: enable KEYBOARD_TEGRA Laxman Dewangan
2013-01-15 18:59 ` Stephen Warren
2013-01-11 13:33 ` [PATCH RFT 3/3] ARM: tegra: dts: seaboard: enable keyboard Laxman Dewangan
2013-01-11 23:09 ` Stephen Warren
2013-01-11 23:24 ` Russell King - ARM Linux
2013-01-11 23:27 ` Stephen Warren
2013-01-11 23:36 ` Russell King - ARM Linux
2013-01-11 23:39 ` Stephen Warren [this message]
2013-01-12 10:34 ` Laxman Dewangan
2013-01-12 10:47 ` Russell King - ARM Linux
2013-01-12 11:06 ` Laxman Dewangan
2013-01-14 16:45 ` Stephen Warren
2013-01-14 16:55 ` Russell King - ARM Linux
2013-01-12 10:02 ` Laxman Dewangan
2013-01-14 22:09 ` Stephen Warren
2013-01-14 22:32 ` Stephen Warren
2013-01-15 18:59 ` [PATCH 1/3] ARM: DT: tegra: add DT entry for KBC controller Stephen Warren
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=50F0A2A8.3080401@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=ldewangan@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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