Re: [RFC][PATCH 1/2] Clocklib: add generic framework for managing clocks.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitry Baryshkov
Date: Wednesday, May 28, 2008 - 8:34 am

Hi,

On Wed, May 28, 2008 at 03:56:45PM +0200, Haavard Skinnemoen wrote:

That can be changed to plain long.


I don't think it's a primary task...


:)


No, that's not my goal.


Sorry, I don't understand you. Here is the definition from the C file:
struct clk {
	struct kobject kobj;
	int usage;
	const struct clk_ops *ops;
	void *data;
};

Which fields are useless from your POV? The mid-layer manages clocks
registration, so kobj. It manages usage (enablement) counters.
It serves per-clock operations. What do you dislike here?


Citing Documentation/kobject.txt:
Because kobjects are dynamic, they must not be declared statically or on
the stack, but instead, always allocated dynamically.  Future versions of
the kernel will contain a run-time check for kobjects that are created
statically and will warn the developer of this improper usage.

However as static devices do work, we can probably go that way.


ok.


try_module_get()/module_put() won't help.
Stalling the unregistration sounds pretty bad also. However maybe we
should just BUG() in such cases :)


OK.


Haavard, if I return struct clk definition to header, permit clocks to
be allocated statically, drop again that "priv" in favour of embedding,
would you agree on kobject-based implementation? I'd really like to use
them. Because otherwise we are nearly reimplementing them from scratch.

-- 
With best wishes
Dmitry

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][PATCH 0/2] Clocklib: generic clocks framework, Dmitry Baryshkov, (Thu May 22, 2:19 pm)
Re: [RFC][PATCH 1/2] Clocklib: add generic framework for m ..., Haavard Skinnemoen, (Wed May 28, 12:44 am)
Re: [RFC][PATCH 1/2] Clocklib: add generic framework for m ..., Haavard Skinnemoen, (Wed May 28, 6:56 am)
Re: [RFC][PATCH 1/2] Clocklib: add generic framework for m ..., Dmitry Baryshkov, (Wed May 28, 8:34 am)
Re: [RFC][PATCH 1/2] Clocklib: add generic framework for m ..., Haavard Skinnemoen, (Wed May 28, 12:52 pm)