Re: [PATCH 4/6] mfd/ab8500: print switch off cause

From: Samuel Ortiz
Date: Tue May 01 2012 - 07:16:34 EST


Hi Linus,

On Tue, Apr 17, 2012 at 09:30:40AM +0200, Linus Walleij wrote:
> @@ -1139,7 +1149,20 @@ int __devinit ab8500_init(struct ab8500 *ab8500, enum ab8500_version version)
> AB8500_SWITCH_OFF_STATUS, &value);
> if (ret < 0)
> return ret;
> - dev_info(ab8500->dev, "switch off status: %#x", value);
> + dev_info(ab8500->dev, "switch off cause(s) (%#x): ", value);
> +
> + if (value) {
> + for (i = 0; i < ARRAY_SIZE(switch_off_status); i++) {
> + if (value & 1)
> + printk("\"%s\" ", switch_off_status[i]);
> + value = value >> 1;
> +
> + }
> + printk("\n");
> + } else {
> + printk("None\n");
> + }
So if your default loglevel is not KERN_INFO, you may miss the dev_info
output while getting the printk one. Why not using dev_info() only with e.g.
tabs for the causes ?

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/
--
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/