RE: [PATCH v3 1/2] i2c: add DMA support for freescale i2c driver

From: Yao Yuan
Date: Wed Mar 26 2014 - 01:56:49 EST


On Wednesday, March 26, 2014 at 11:43:27 AM, Marek Vasut wrote:
> On Wednesday, March 26, 2014 at 04:08:27 AM, Yao Yuan wrote:
>
> [...]
>
> > > > + i2c_imx->use_dma = false;
> > > > + } else if (i2c_imx_dma_request(i2c_imx, (dma_addr_t)phy_addr))
> {
> > > > + dev_info(&pdev->dev,
> > > > + "can't request dma chan, faild use dma.\n");
> > > > + i2c_imx->use_dma = false;
> > > > + } else {
> > > > + i2c_imx->use_dma = true;
> > > > + }
> > >
> > > Can you not just check if i2c_imx->dma is valid pointer or NULL
> pointer ?
> > > Then you won't need a separate variable, for this purpose ... right ?
> >
> > Sorry and I think what I know is just to check whether it is NULL.
> > Then for the second question, maybe there are some other ways, But I
> > think it is more tidy and easier understanding for using a separate
> > variable, for this purpose.
>
> You are just wasting space and duplicating data, unless I am wrong.
>

Well, Do you have a better idea? Although I think it's necessary.


Best regards,
Yuan Yao
N‹§²æ¸›yú²X¬¶ÇvØ–)Þ{.nlj·¥Š{±‘êX§¶›¡Ü}©ž²ÆzÚj:+v‰¨¾«‘êZ+€Êzf£¢·hšˆ§~†­†Ûÿû®w¥¢¸?™¨è&¢)ßf”ùy§m…á«a¶Úÿ 0¶ìå