Cyril Chemparathy <[email protected]> writes:

> This patch allows for a more flexible ioremap() interception based on iotable
> contents.
>
> SoCs that need ioremap() to fill up davinci_soc_info may directly call
> davinci_io_init() and use ioremap() as needed.  Such SoCs must not fill
> io_desc and io_desc_num entries in struct davinci_soc_info.
>
> Signed-off-by: Cyril Chemparathy <[email protected]>
> Tested-by: Sandeep Paulraj <[email protected]>

Very nice...   one minor nit below...

[...]

> +
> +void __init davinci_io_init(struct map_desc *desc, unsigned long desc_num)
> +{
> +     if (!desc || !desc_num)
> +             return;
> +
> +     /* silently refuse to init twice ...*/
> +     if (davinci_io_desc) {
> +             /* ... unless things change */
> +             BUG_ON(davinci_io_desc != desc ||
> +                     davinci_io_desc_num != desc_num);

Should be a WARN_ON() here.  This is non fatal, and easy
to recover from.  (c.f. include/asm-generic/bug.h, below)

Kevin


/*
 * Don't use BUG() or BUG_ON() unless there's really no way out; one
 * example might be detecting data structure corruption in the middle
 * of an operation that can't be backed out of.  If the (sub)system
 * can somehow continue operating, perhaps with reduced functionality,
 * it's probably not BUG-worthy.
 *
 * If you're tempted to BUG(), think again:  is completely giving up
 * really the *only* solution?  There are usually better options, where
 * users don't need to reboot ASAP and can mostly shut down cleanly.
 */
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to