lkml.org 
[lkml]   [2014]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/2] i2c: New bus driver for the Qualcomm QUP I2C controller
On Thu 20 Feb 18:53 PST 2014, Emilio L?pez wrote:

> Hi Bjorn,
>
> El 20/02/14 21:38, Bjorn Andersson escribió:
[...]
> > + clk_freq = 100000;
> > + if (!of_property_read_u32(node, "clock-frequency", &val))
> > + clk_freq = val;
>
> val will be modified only if no error occurs, so you may rewrite this
> bit as
>
> + u32 clk_freq = 100000;
> ...
> + of_property_read_u32(node, "clock-frequency", &clk_freq)

Seems the two conventions used in the kernel is either your proposal or "if
fail the assign default". So I'll change this.

>
> > +
> > + /* We support frequencies up to FAST Mode (400KHz) */
> > + if (clk_freq <= 0 || clk_freq > 400000) {
>
> And you can drop the < check when it's unsigned.

Indeed!

>
> > + dev_err(qup->dev, "clock frequency not supported %d\n",
> > + clk_freq);
> > + return -EIO;
>
> EIO?

EINVAL

>
> Cheers,
>
> Emilio

Thanks,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-02-24 19:41    [W:0.136 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site