[PATCH v4 4/5] OMAP: mailbox: build device using omap_device/omap_hwmod
Russell King - ARM Linux
linux at arm.linux.org.uk
Thu Dec 16 03:44:46 EST 2010
On Thu, Dec 16, 2010 at 02:08:11PM +0530, Varadarajan, Charulatha wrote:
> > + oh = omap_hwmod_lookup("mailbox");
> > + if (!oh) {
> > + pr_err("%s: unable to find hwmod\n", __func__);
> > + return;
> > + }
> > +
> > + od = omap_device_build("omap-mailbox", -1, oh,
> > + NULL, 0,
> > + mbox_latencies, ARRAY_SIZE(mbox_latencies),
> > + 0);
> > + if (!od) {
>
> Check for IS_ERR(od).
>
> > + pr_err("%s: could not build device\n", __func__);
If you have an API which returns errors, and you're bothering to print
something when an error occurs, it's often useful to print the returned
error code, so that people can find out _why_ the error occurred.
More information about the linux-arm-kernel
mailing list