From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v3 10/15] serial: stm32-usart: Add STM32 USART Driver Date: Thu, 26 Mar 2015 23:05:52 +0100 Message-ID: References: <1426197361-19290-1-git-send-email-maxime.coquelin@st.com> <1426197361-19290-11-git-send-email-maxime.coquelin@st.com> <5511ABAA.2010303@hurleysoftware.com> <20150326154618.GO8656@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <20150326154618.GO8656@n2100.arm.linux.org.uk> Sender: linux-arch-owner@vger.kernel.org To: Russell King - ARM Linux Cc: Peter Hurley , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Geert Uytterhoeven , Rob Herring , Philipp Zabel , Linus Walleij , Arnd Bergmann , Stefan Agner , Peter Meerwald , Paul Bolle , Jonathan Corbet , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Daniel Lezcano , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Andrew Morton , "David S. Miller" List-Id: linux-gpio@vger.kernel.org 2015-03-26 16:46 GMT+01:00 Russell King - ARM Linux : > On Tue, Mar 24, 2015 at 02:23:38PM -0400, Peter Hurley wrote: >> Hi Maxime, >> >> On 03/12/2015 05:55 PM, Maxime Coquelin wrote: >> > +static unsigned int stm32_get_mctrl(struct uart_port *port) >> > +{ >> > + /* >> > + * This routine is used for geting signals of: DTR, DCD, DSR, RI, >> > + * and CTS/RTS > > It's also worth noting that this comment is wrong. This is used to get > the state of DCD, DSR, RI and CTS. DTR and RTS are *not* included > because the core tracks their state. OK, thanks for pointing this. I will fix the comment in the v4. > > ... > >> > + stm32port->clk = devm_clk_get(&pdev->dev, NULL); >> > + >> > + if (WARN_ON(IS_ERR(stm32port->clk))) >> >> Do you really need a stack trace here? Could this be dev_err() instead? >> >> > + return -EINVAL; > > Also, propagate the error code. Ok. > >> > + >> > + /* ensure that clk rate is correct by enabling the clk */ >> > + clk_prepare_enable(stm32port->clk); > > And remember to check the return value of clk_prepare_enable(). I will. Thanks for the review, Maxime > > -- > FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up > according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753388AbbCZWGA (ORCPT ); Thu, 26 Mar 2015 18:06:00 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:33034 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752709AbbCZWFy (ORCPT ); Thu, 26 Mar 2015 18:05:54 -0400 MIME-Version: 1.0 In-Reply-To: <20150326154618.GO8656@n2100.arm.linux.org.uk> References: <1426197361-19290-1-git-send-email-maxime.coquelin@st.com> <1426197361-19290-11-git-send-email-maxime.coquelin@st.com> <5511ABAA.2010303@hurleysoftware.com> <20150326154618.GO8656@n2100.arm.linux.org.uk> Date: Thu, 26 Mar 2015 23:05:52 +0100 Message-ID: Subject: Re: [PATCH v3 10/15] serial: stm32-usart: Add STM32 USART Driver From: Maxime Coquelin To: Russell King - ARM Linux Cc: Peter Hurley , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Geert Uytterhoeven , Rob Herring , Philipp Zabel , Linus Walleij , Arnd Bergmann , Stefan Agner , Peter Meerwald , Paul Bolle , Jonathan Corbet , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Daniel Lezcano , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Andrew Morton , "David S. Miller" , Mauro Carvalho Chehab , Joe Perches , Antti Palosaari , Tejun Heo , Will Deacon , Nikolay Borisov , Rusty Russell , Kees Cook , Michal Marek , "linux-doc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-serial@vger.kernel.org" , Linux-Arch , "linux-api@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2015-03-26 16:46 GMT+01:00 Russell King - ARM Linux : > On Tue, Mar 24, 2015 at 02:23:38PM -0400, Peter Hurley wrote: >> Hi Maxime, >> >> On 03/12/2015 05:55 PM, Maxime Coquelin wrote: >> > +static unsigned int stm32_get_mctrl(struct uart_port *port) >> > +{ >> > + /* >> > + * This routine is used for geting signals of: DTR, DCD, DSR, RI, >> > + * and CTS/RTS > > It's also worth noting that this comment is wrong. This is used to get > the state of DCD, DSR, RI and CTS. DTR and RTS are *not* included > because the core tracks their state. OK, thanks for pointing this. I will fix the comment in the v4. > > ... > >> > + stm32port->clk = devm_clk_get(&pdev->dev, NULL); >> > + >> > + if (WARN_ON(IS_ERR(stm32port->clk))) >> >> Do you really need a stack trace here? Could this be dev_err() instead? >> >> > + return -EINVAL; > > Also, propagate the error code. Ok. > >> > + >> > + /* ensure that clk rate is correct by enabling the clk */ >> > + clk_prepare_enable(stm32port->clk); > > And remember to check the return value of clk_prepare_enable(). I will. Thanks for the review, Maxime > > -- > FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up > according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 From: mcoquelin.stm32@gmail.com (Maxime Coquelin) Date: Thu, 26 Mar 2015 23:05:52 +0100 Subject: [PATCH v3 10/15] serial: stm32-usart: Add STM32 USART Driver In-Reply-To: <20150326154618.GO8656@n2100.arm.linux.org.uk> References: <1426197361-19290-1-git-send-email-maxime.coquelin@st.com> <1426197361-19290-11-git-send-email-maxime.coquelin@st.com> <5511ABAA.2010303@hurleysoftware.com> <20150326154618.GO8656@n2100.arm.linux.org.uk> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 2015-03-26 16:46 GMT+01:00 Russell King - ARM Linux : > On Tue, Mar 24, 2015 at 02:23:38PM -0400, Peter Hurley wrote: >> Hi Maxime, >> >> On 03/12/2015 05:55 PM, Maxime Coquelin wrote: >> > +static unsigned int stm32_get_mctrl(struct uart_port *port) >> > +{ >> > + /* >> > + * This routine is used for geting signals of: DTR, DCD, DSR, RI, >> > + * and CTS/RTS > > It's also worth noting that this comment is wrong. This is used to get > the state of DCD, DSR, RI and CTS. DTR and RTS are *not* included > because the core tracks their state. OK, thanks for pointing this. I will fix the comment in the v4. > > ... > >> > + stm32port->clk = devm_clk_get(&pdev->dev, NULL); >> > + >> > + if (WARN_ON(IS_ERR(stm32port->clk))) >> >> Do you really need a stack trace here? Could this be dev_err() instead? >> >> > + return -EINVAL; > > Also, propagate the error code. Ok. > >> > + >> > + /* ensure that clk rate is correct by enabling the clk */ >> > + clk_prepare_enable(stm32port->clk); > > And remember to check the return value of clk_prepare_enable(). I will. Thanks for the review, Maxime > > -- > FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up > according to speedtest.net.