From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lyra Zhang Subject: Re: [PATCH v3 5/5] tty/serial: Add Spreadtrum sc9836-uart driver support Date: Thu, 27 Nov 2014 19:39:36 +0800 Message-ID: References: <1416917818-10506-1-git-send-email-chunyan.zhang@spreadtrum.com> <1416917818-10506-6-git-send-email-chunyan.zhang@spreadtrum.com> <20141126094838.GB17980@distanz.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <20141126094838.GB17980@distanz.ch> Sender: linux-doc-owner@vger.kernel.org To: Tobias Klauser Cc: Chunyan Zhang , Grant Likely , "robh+dt@kernel.org" , Catalin Marinas , "gregkh@linuxfoundation.org" , "ijc+devicetree@hellion.org.uk" , "jslaby@suse.cz" , Kumar Gala , Mark Brown , Mark Rutland , "m-karicheri2@ti.com" , Pawel Moll , Ramkumar Ramachandra , "rrichter@cavium.com" , Will Deacon , Arnd Bergmann , gnomes@lxorguk.ukuu.org.uk, Jonathan Corbet , jason@lakedaemon.net, Mark Brown , =?UTF-8?Q?Heiko_St=C3=BCbner?= , shawn.guo@freescale.com, florian.vaussard@ List-Id: linux-api@vger.kernel.org 2014-11-26 17:48 GMT+08:00 Tobias Klauser : > On 2014-11-25 at 13:16:58 +0100, Chunyan Zhang wrote: >> --- [...] >> + >> +config SERIAL_SPRD_CONSOLE >> + bool "SPRD UART console support" >> + depends on SERIAL_SPRD=y >> + select SERIAL_CORE_CONSOLE >> + select SERIAL_EARLYCON >> + help >> + Support for early debug console using Spreadtrum's serial. This enables >> + the console before standard serial driver is probed. This is enabled >> + with "earlycon" on the kernel command line. The console is >> + enabled when early_param is processed. >> + >> endmenu > > Please consistently use tabs instead of spaces for indentation. The help > text should be indented by one tabe + 2 spaces. > OK, I will note it later. [...] >> +static inline int handle_lsr_errors(struct uart_port *port, >> + unsigned int *flag, unsigned int *lsr) > > This line should be aligned with the opening ( above. > OK, will change. >> +static inline void sprd_rx(int irq, void *dev_id) >> +{ >> + struct uart_port *port = (struct uart_port *)dev_id; > > No need to cast a void pointer. > >> +static void sprd_console_write(struct console *co, const char *s, >> + unsigned int count) >> +{ >> + struct uart_port *port = (struct uart_port *)sprd_port[co->index]; > > Better explicitly access the .port member of sprd_port[co->index] here > instead of casting. > >> + port = (struct uart_port *)sprd_port[co->index]; > > Same here, use the .port member of struct sprd_port[co->index]. > >> + if (port == NULL) { >> + pr_info("srial port %d not yet initialized\n", co->index); > > Typo: should be serial instead of srial. > >> + up->mapbase = mem->start; >> + up->membase = ioremap(mem->start, resource_size(mem)); > > Return value of ioremap() should be checked for NULL. > >> +static int sprd_resume(struct platform_device *dev) >> +{ >> + int id = dev->id; >> + struct uart_port *port = (struct uart_port *)sprd_port[id]; > > Access the .port member instead of the cast. > OK, will change all of the problems you pointed out in v4. Thanks for your review. Chunyan