Cc: Gary Hade <garyhade@...>, Ingo Molnar <mingo@...>, Thomas Meyer <thomas@...>, Stefan Richter <stefanr@...>, Thomas Gleixner <tglx@...>, Rafael J. Wysocki <rjw@...>, LKML <linux-kernel@...>, Adrian Bunk <bunk@...>, Andrew Morton <akpm@...>, Natalie Protasevich <protasnb@...>, Benjamin Herrenschmidt <benh@...>, <pm@...>
[...]
Don't do the BUG_ON(). That would just cause a broken machine, and makes
it much harder to report this issue. BUG_ON() should be used only for
totally unfixable things.
In this case, the easy thing to do is to just return an error, possibly
with a printk() about bogus resources (ignoring it as a resource, the way
we do it in pdev_sort_resource()).
But other than that, the thing doesn't look horrible.
Linus
--