Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_I2C driver to 2.6.35

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joe,

Thank you for your comments.

Best Regards,
Ohtake(OKISemi)

----- Original Message ----- 
From: "Joe Perches" <joe@xxxxxxxxxxx>
To: "Masayuki Ohtake" <masa-korg@xxxxxxxxxxxxxxx>
Cc: "Jean Delvare (PC drivers, core)" <khali@xxxxxxxxxxxx>; "Ben Dooks (embedded platforms)" <ben-linux@xxxxxxxxx>;
"Crane Cai" <crane.cai@xxxxxxx>; "Samuel Ortiz" <sameo@xxxxxxxxxxxxxxx>; "Linus Walleij" <linus.walleij@xxxxxxxxxxxxxx>;
"Ralf Baechle" <ralf@xxxxxxxxxxxxxx>; "srinidhi kasagar" <srinidhi.kasagar@xxxxxxxxxxxxxx>; <linux-i2c@xxxxxxxxxxxxxxx>;
<linux-kernel@xxxxxxxxxxxxxxx>; "Wang Yong Y"" <yong.y.wang@xxxxxxxxx>; "Wang Qi"" <qi.wang@xxxxxxxxx>; "Andrew""
<andrew.chih.howe.khor@xxxxxxxxx>; <arjan@xxxxxxxxxxxxxxx>; "Tomoya MORINAGA" <morinaga526@xxxxxxxxxxxxxxx>; "Arnd
Bergmann" <arnd@xxxxxxxx>
Sent: Wednesday, September 01, 2010 2:24 PM
Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_I2C driver to 2.6.35


> On Wed, 2010-09-01 at 14:08 +0900, Masayuki Ohtake wrote:
> > I have a question.
> > Current our I2C driver  has the following 2 patterns dev_err().
> > (1) dev_err(adap->pch_adapter.dev.parent, "...");
> > (2) dev_err(&pdev->dev, "...");
> > > #define pch_err(adap, fmt, arg...) \
> > > dev_err(adap->pch_adapter.dev.parent, fmt, ##arg)
> > In case of using the above code, pattern (1) can apply, but (2) can't.
> > As to (2),
> > Should we use as dev_err or define another macro?
>
> Hello Ohtake.
>
> To me, it's a visual complexity vs std pattern trade-off.
>
> A 2 level dereference like dev_info(&dev->dev, ...)
> isn't overly difficult to read.
> 3 or more dereferences can be harder and a bit error prone.
> So I would only use pch_<level> for (1) and dev_err for (2).
>
> There are also times when there are additional standard
> arguments that you want to prefix to dev_<level> calls
> and that can be simplified with a custom XXX_<level>
> define for dev_<level>
>
> Look at the current uses in the tree and see what you like.
>
> $ grep -rP --include=*.[ch] "#define\s*.+\s+dev_[a-z]{3,7}\s*\(" *
>
> These aren't requirements, do what you think best.
>
> cheers, Joe
>


--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux