Re: [patch 2.6.28-rc7] regulator: catch some registration errors

From: Liam Girdwood
Date: Wed Dec 03 2008 - 16:48:54 EST


On Mon, 2008-12-01 at 21:50 -0800, David Brownell wrote:
> From: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
>
> Prevent registration of duplicate "struct regulator" names.
> They'd be unavailable, and clearly indicate something wrong.

This part is fine.

>
> Also make sure the consumer device is provided. It's nonsensical
> to omit these, and not a documented part of the interface. Since
> no code in mainline does such stuff, this is just anti-oops medicine.
>

I think Mark has probably mentioned the need to support CPUfreq drivers
with no struct device. I had a quick scan of the current in tree ARM
CPUfreq drivers and could not find one that uses struct device (someone
will now find one).

I wonder if there is another way to approach this as I do agree that
passing NULL is probably not the best solution. Alternatives like
embedding struct device with the CPUfreq core or adding a regulator_get
API call for CPUfreq drivers all involve some work. Fwiw, I'd be happy
enough with the latter option.

Thanks

Liam

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/