<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/core/uclass.c, branch v2016.05</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>dm: core: Add uclass_first_device_err() to return a valid device</title>
<updated>2016-03-14T21:34:50+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2016-02-11T20:23:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b06750501f5c0eef7fef094f13d2f2e313c60b79'/>
<id>b06750501f5c0eef7fef094f13d2f2e313c60b79</id>
<content type='text'>
A common pattern is to call uclass_first_device() and then check if it
actually returns a device. Add a new function which does this, returning
an error if there are no devices in that uclass.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A common pattern is to call uclass_first_device() and then check if it
actually returns a device. Add a new function which does this, returning
an error if there are no devices in that uclass.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: core: Export uclass_find_device_by_of_offset()</title>
<updated>2016-01-22T03:42:35+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2016-01-22T02:43:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1b30d61d786421a5d02725a9945552cc9c09914b'/>
<id>1b30d61d786421a5d02725a9945552cc9c09914b</id>
<content type='text'>
It is sometimes useful to be able to find a device before probing it,
perhaps to set up some platform data for it. Allow finding by of_offset
also.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is sometimes useful to be able to find a device before probing it,
perhaps to set up some platform data for it. Allow finding by of_offset
also.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: core: Call uclass post_bind() after the driver's bind() method</title>
<updated>2016-01-21T02:06:22+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2016-01-05T16:30:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=20af3c0a0034b885cd269cb7abdc2d933d82a723'/>
<id>20af3c0a0034b885cd269cb7abdc2d933d82a723</id>
<content type='text'>
At present the uclass's post_bind() method is called before the driver's
bind() method. This means that the uclass cannot use any of the information
set up by the driver. Move it later in the sequence to permit this.

This is an ordering change which is always fairly major in nature. The main
impact is that devices which have children will not see them appear in their
bind() method. From what I can see, existing drivers do not look at their
children in the bind() method, so this should be safe.

Conceptually this change seems to result in a 'more correct' ordering, since
the uclass (which is broader than the device) gets the last word.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At present the uclass's post_bind() method is called before the driver's
bind() method. This means that the uclass cannot use any of the information
set up by the driver. Move it later in the sequence to permit this.

This is an ordering change which is always fairly major in nature. The main
impact is that devices which have children will not see them appear in their
bind() method. From what I can see, existing drivers do not look at their
children in the bind() method, so this should be safe.

Conceptually this change seems to result in a 'more correct' ordering, since
the uclass (which is broader than the device) gets the last word.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: core: Provide uclass_find_device_by_phandle() only when needed</title>
<updated>2016-01-21T02:06:21+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2015-12-20T02:38:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c275dfefebb95c1ffdca630a65055a850b83adc7'/>
<id>c275dfefebb95c1ffdca630a65055a850b83adc7</id>
<content type='text'>
This function cannot be used unless support is enabled for device tree
control. Adjust the code to reflect that.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This function cannot be used unless support is enabled for device tree
control. Adjust the code to reflect that.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: core: Remove unnecessary codes in uclass_pre_remove_device()</title>
<updated>2015-10-29T19:05:51+00:00</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2015-10-08T04:32:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=50dae85c713e11c52abf25dfd283db336257dbc5'/>
<id>50dae85c713e11c52abf25dfd283db336257dbc5</id>
<content type='text'>
dev-&gt;uclass-&gt;uc_drv-&gt;per_device_auto_alloc_size is to be freed in
device_free(), so is dev-&gt;seq. Remove these unnecessary codes.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dev-&gt;uclass-&gt;uc_drv-&gt;per_device_auto_alloc_size is to be freed in
device_free(), so is dev-&gt;seq. Remove these unnecessary codes.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: Improve handling of a missing uclass</title>
<updated>2015-09-03T03:28:23+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2015-08-30T22:55:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3346c87625b8a736af5636a0bd1be89f781eb5f2'/>
<id>3346c87625b8a736af5636a0bd1be89f781eb5f2</id>
<content type='text'>
When a uclass definition is missing, no drivers in that uclass can operate.
This can happen if a board has a strange collection of options (e.g. the
driver is enabled but the uclass is not).

Unfortunately this is very confusing at present. Starting up driver model
results in a -ENOENT error, which is pretty generic. Quite a big of digging
is needed to get to the root cause.

To help with this, change the error to a very strange one with no other
users in U-Boot. Also add a debug message.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a uclass definition is missing, no drivers in that uclass can operate.
This can happen if a board has a strange collection of options (e.g. the
driver is enabled but the uclass is not).

Unfortunately this is very confusing at present. Starting up driver model
results in a -ENOENT error, which is pretty generic. Quite a big of digging
is needed to get to the root cause.

To help with this, change the error to a very strange one with no other
users in U-Boot. Also add a debug message.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: drop CONFIG_DM_DEVICE_REMOVE from uncmd list</title>
<updated>2015-08-18T17:46:04+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2015-08-11T22:31:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0a5804b53a3c71dc0c9c43e5c747015b6e50e9e1'/>
<id>0a5804b53a3c71dc0c9c43e5c747015b6e50e9e1</id>
<content type='text'>
We do not want to compile the DM remove code for SPL.  Currently,
we undef it in include/config_uncmd_spl.h (for C files) and in
scripts/Makefile.uncmd_spl (for Makefiles).  This is really ugly.

This commit demonstrates how we can deprecate those two files.

Use $(SPL_) for the entry in the Makfile and CONFIG_IS_ENABLED()
in C files.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We do not want to compile the DM remove code for SPL.  Currently,
we undef it in include/config_uncmd_spl.h (for C files) and in
scripts/Makefile.uncmd_spl (for Makefiles).  This is really ugly.

This commit demonstrates how we can deprecate those two files.

Use $(SPL_) for the entry in the Makfile and CONFIG_IS_ENABLED()
in C files.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: core: Support finding a device by phandle</title>
<updated>2015-08-06T02:57:51+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2015-07-03T00:15:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d82ba4c0b457f0cb30da7bbee935aad7793e5fac'/>
<id>d82ba4c0b457f0cb30da7bbee935aad7793e5fac</id>
<content type='text'>
It is common for one node to reference another via a phandle. Add support
for obtaining an attached device by this method. As an example, a node may
have a 'power-supply' property which references a regulator, allowing the
driver to turn on its power.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is common for one node to reference another via a phandle. Add support
for obtaining an attached device by this method. As an example, a node may
have a 'power-supply' property which references a regulator, allowing the
driver to turn on its power.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: core: Check for empty list in uclass_find_device()</title>
<updated>2015-08-05T14:42:40+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2015-07-31T15:31:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2fda14ae6aa36798b59ab0591a2009ead206159b'/>
<id>2fda14ae6aa36798b59ab0591a2009ead206159b</id>
<content type='text'>
This function needs to check the list has entries before traversing it.
Fix this bug.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This function needs to check the list has entries before traversing it.
Fix this bug.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: change dm_warn() message into debug() in uclass_add()</title>
<updated>2015-07-21T23:39:34+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2015-07-07T09:51:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=643e69021ef921c6ea63da9fc274c0de5a3d0eed'/>
<id>643e69021ef921c6ea63da9fc274c0de5a3d0eed</id>
<content type='text'>
The command "dm uclass" tries to display all the UClasses, but
some of them might be disabled by Kconfig.

The function do_dm_dump_uclass() iterates over all the UClass IDs
and calls uclass_get() for each of them.  Then, it displays annoying
message "Cannot find uclass for id ..." every time it fails to get
the UClass.

As a result, we get much noisier log for the "dm uclass" command.

  =&gt; dm uclass
  uclass 0: root
  - * root_driver @ bfb54028, seq 0, (req -1)

  Cannot find uclass for id 1: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 2: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 3: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 4: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 5: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 6: please add the UCLASS_DRIVER() ...

This commit suppresses these warnings.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The command "dm uclass" tries to display all the UClasses, but
some of them might be disabled by Kconfig.

The function do_dm_dump_uclass() iterates over all the UClass IDs
and calls uclass_get() for each of them.  Then, it displays annoying
message "Cannot find uclass for id ..." every time it fails to get
the UClass.

As a result, we get much noisier log for the "dm uclass" command.

  =&gt; dm uclass
  uclass 0: root
  - * root_driver @ bfb54028, seq 0, (req -1)

  Cannot find uclass for id 1: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 2: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 3: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 4: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 5: please add the UCLASS_DRIVER() ...
  Cannot find uclass for id 6: please add the UCLASS_DRIVER() ...

This commit suppresses these warnings.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
