Hi, Mark Think twice. Yes, you are right. "of_get_property" is not necessary here. Thanks for your suggestion. > -----Original Message----- > From: linux-serial-owner@xxxxxxxxxxxxxxx [mailto:linux-serial- > owner@xxxxxxxxxxxxxxx] On Behalf Of Yao Yuan > Sent: Thursday, January 16, 2014 2:54 PM > To: Mark Rutland > Cc: gregkh@xxxxxxxxxxxxxxxxxxx; shawn.guo@xxxxxxxxxx; > linux@xxxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; > arnd@xxxxxxxx; linux-serial@xxxxxxxxxxxxxxx > Subject: RE: [PATCH v3 2/2] serial: fsl_lpuart: add DMA support > > Hi, mark > > > -----Original Message----- > > > +#ifdef CONFIG_SERIAL_FSL_LPUART_DMA > > > + struct platform_device *pdev = to_platform_device(port->dev); > > > + struct device_node *np = pdev->dev.of_node; > > > + > > > + if (of_get_property(np, "dmas", NULL)) { > > > + sport->lpuart_dma_use = true; > > > + lpuart_dma_tx_request(port); > > > + lpuart_dma_rx_request(port); > > > + temp = readb(port->membase + UARTCR5); > > > + writeb(temp | UARTCR5_TDMAS, port->membase + > > > + UARTCR5); > > > > Rather than reading the raw dt to find out if you have dmas, can you > > not just attempt to request the dmas and if either fail give up on > using them? > > Yes, the dma request function can also confirm it. But maybe it's better > that add the judge as a dma entrance first? > I think if the dmas is be written it means dma want be support. At this > time, rather than silently change to no dma model, we may throw the error > when some errors happened. > But dma request failed may have many other reasons. Also the judge will > just run only once, it will not waste of performance. > If the dmas is not be written, we don't need to do anything about dma. > 칻 & ~ & +- ݶ w ˛ m b lz ) w*jg ݢj/ z ޖ 2 ޙ > & )ߡ a G h j:+v w ٥ ��.n��������+%������w��{.n�����{��ǫ����{ay�ʇڙ���f���h������_�(�階�ݢj"��������G����?���&��