mbox series

[0/2] add kobject/of_node read() function

Message ID 87bmerv9ll.wl%kuninori.morimoto.gx@renesas.com
Headers show
Series add kobject/of_node read() function | expand

Message

Kuninori Morimoto April 10, 2018, 6:53 a.m. UTC
Hi Greg, Rob, Frank

We are using {kobject_/of_node_}get/put() for increment/decrement
counter. But, because we don't have counter read() function,
confirming it (mainly for debug purpose) is a little bit difficult.
These patches add read() function for it.

Kuninori Morimoto (2):
  kobject: add kobject_read()
  of: add of_node_read()

 drivers/of/dynamic.c    | 14 ++++++++++++++
 include/linux/kobject.h |  1 +
 include/linux/of.h      |  5 +++++
 lib/kobject.c           | 18 ++++++++++++++++++
 4 files changed, 38 insertions(+)

Comments

Greg Kroah-Hartman April 10, 2018, 7:10 a.m. UTC | #1
On Tue, Apr 10, 2018 at 06:53:50AM +0000, Kuninori Morimoto wrote:
> 
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> We are counting kobject by using kobject_get/put(), but
> not have kobject_read() which can be used to check count.
> Let's add

No, please do not.  You should never care about this "count", and if we
do provide this, people will abuse it.

I understand that this might make some debugging harder, but if you
really need to write custom debugging code, then just use the internal
values.

sorry,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html