Re: [PATCH RFT 3/3] ARM: tegra: dts: seaboard: enable keyboard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/...
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux