From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1] clk: clk-uclass: Check ops pointer before use it
Date: Wed, 17 Aug 2016 21:55:46 -0600 [thread overview]
Message-ID: <e3671cbf-491b-667b-b308-4dde8e2b94de@wwwdotorg.org> (raw)
In-Reply-To: <F9F4555C4E01D7469D37975B62D0EFBB3A544F@CHN-SV-EXMX07.mchp-main.com>
On 08/17/2016 09:53 PM, Wenyou.Yang at microchip.com wrote:
> Hi Stephen,
>
>> -----Original Message-----
>> From: Stephen Warren [mailto:swarren at wwwdotorg.org]
>> Sent: 2016?8?18? 11:46
>> To: Wenyou Yang - A41535 <Wenyou.Yang@microchip.com>;
>> wenyou.yang at atmel.com
>> Cc: u-boot at lists.denx.de; swarren at nvidia.com; michal.simek at xilinx.com
>> Subject: Re: [U-Boot] [PATCH v1] clk: clk-uclass: Check ops pointer before use it
>>
>> On 08/17/2016 06:30 PM, Wenyou.Yang at microchip.com wrote:
>>> HI Stephen,
>>>
>>>> -----Original Message-----
>>>> From: Stephen Warren [mailto:swarren at wwwdotorg.org]
>>>> Sent: 2016?8?17? 23:59
>>>> To: Wenyou Yang <wenyou.yang@atmel.com>
>>>> Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Stephen Warren
>>>> <swarren@nvidia.com>; Michal Simek <michal.simek@xilinx.com>
>>>> Subject: Re: [U-Boot] [PATCH v1] clk: clk-uclass: Check ops pointer
>>>> before use it
>>>>
>>>> On 08/17/2016 01:05 AM, Wenyou Yang wrote:
>>>>> Add check ops pointer before use it. Otherwise, it will cause the
>>>>> runtime error for the clk devices without ops callback.
>>>>
>>>> Other uclasses like reset, power domain, and mailbox don't do this.
>>>> All drivers must have an ops pointer, or they can't be useful. I'm
>>>> not sure this patch is necessary. Is it just a debugging aid so if
>>>> the driver writer forgets to set the ops pointer the system will
>>>> error out rather than crashing? If so, a post-bind hook in the uclass that
>> refuses the driver if it hasn't set the ops pointer would be better.
>>>
>>> Sorry, I don't agree with you.
>>>
>>> Not all drivers have an ops pointer.
>>>
>>> If you grep U_BOOT_DRIVER , you will find that there are some drivers without
>> an ops pointer.
>>>
>>> We should not suppose a driver should have something, I think.
>>
>> But without an ops pointer, the driver can do nothing and provide no services.
>> Why is that useful?
>
> There are some nodes without compatible in device tree, as a child of some node,
> for example, pinctrl child node or for my code peripheral clock node.
>
> These nodes also need to be bound before using them. They require such driver to bind them.
That seems unrelated. A node without a compatible value won't
instantiate a device object, and hence needs no driver.
next prev parent reply other threads:[~2016-08-18 3:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-17 7:05 [U-Boot] [PATCH v1] clk: clk-uclass: Check ops pointer before use it Wenyou Yang
2016-08-17 15:59 ` Stephen Warren
2016-08-18 0:30 ` Wenyou.Yang at microchip.com
2016-08-18 3:45 ` Stephen Warren
2016-08-18 3:53 ` Wenyou.Yang at microchip.com
2016-08-18 3:55 ` Stephen Warren [this message]
2016-08-19 1:49 ` Wenyou.Yang at microchip.com
2016-08-19 3:52 ` Stephen Warren
2016-08-21 16:54 ` Masahiro Yamada
2016-08-23 2:01 ` Wenyou.Yang at microchip.com
2016-08-18 3:45 ` Simon Glass
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=e3671cbf-491b-667b-b308-4dde8e2b94de@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.