[PATCH 03/10] clk: Make NULL a valid clock again

Sascha Hauer
2011-04-19T06:25:43Z

Hi Jeremy,

On Tue, Apr 19, 2011 at 08:53:40AM +0800, Jeremy Kerr wrote:
> Hi Sascha,
>
> > NULL used to be a valid clock. This patch makes the common struct
> > clk stuff work with this. Instead of crashing we return sane default
> > values for this dummy clock, that is: can always be prepared, enabled,
> > rate unkown and no set rate.
>
> Although I'm not totally averse to this change, I've been trying to
> avoid allowing NULL clocks - it seems to be a little 'messy' to allows
> clocks that don't have any possible operations on them, and could hide
> error cases where clock pointers have not been correctly initialised.
>
> However, I understand that this may be required for flexibility between
> machines, and in that case would make sense. Is that what you're
> intending this for?

I intended to use NULL clocks but didn't do it then. The patch was
already created, so I posted it. I think We could equally well create a
dummy clock which can be used by all architectures. People (including
me) never really got used to NULL clocks and it's been a source of
confusion since they have been introduced.

Sascha

--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |