Kevin Hilman
Thu, 18 Mar 2010 07:50:24 -0700
"G, Manjunath Kondaiah" <manj...@ti.com> writes:
>> +#ifdef CONFIG_ARCH_OMAP3
>> +void (*_omap3_sram_delay)(unsigned int);
>> +unsigned int measure_sram_delay(unsigned int loop)
>> +{
>> + static struct omap_dm_timer *gpt;
>> + unsigned long flags, diff = 0, gt_rate, mpurate;
>> + unsigned int delay_sram, error_gain;
>> + unsigned int start = 0, end = 0;
>> +
>> + omap_dm_timer_init();
>> + gpt = omap_dm_timer_request();
>> + if (!gpt) {
>
> Request timer API returns NULL on failure.
> Use BUG_ON(gpt == NULL);
No. BUG_ON() will panic the kernel and hang here. There is no need to crash the kernel for that. Current aproach is fine, or if a more verbose warning is desired, you can use if (WARN_ON(!gpt)) ... and drop the pr_err() Kevin -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html