Re: [PATCH v3 1/7] serial: pxa: add OF support
From: Haojian Zhuang <hidden>
Date: 2012-03-06 15:04:40
Also in:
linux-arm-kernel
On Tue, Mar 6, 2012 at 11:02 PM, Arnd Bergmann [off-list ref] wrote:
On Tuesday 06 March 2012, Haojian Zhuang wrote:quoted
@@ -51,7 +54,7 @@ struct uart_pxa_port {unsigned char mcr; unsigned int lsr_break_flag; struct clk *clk; - char *name; + char name[PXA_NAME_LEN]; };This looks better nowquoted
static inline unsigned int serial_in(struct uart_pxa_port *up, int offset)@@ -781,6 +784,33 @@ static const struct dev_pm_ops serial_pxa_pm_ops = {}; #endif +#ifdef CONFIG_OF +static struct of_device_id serial_pxa_dt_ids[] = { + { .compatible = "mrvl,pxa-uart", }, + { .compatible = "mrvl,mmp-uart", }, + {} +}; +MODULE_DEVICE_TABLE(of, serial_pxa_dt_ids); +#endifIf you do this, you have to use of_match_ptr for referencing serial_pxa_dt_ids or you will get a link error when CONFIG_OF is disabled.quoted
@@ -850,6 +876,7 @@ static int serial_pxa_remove(struct platform_device *dev)platform_set_drvdata(dev, NULL); uart_remove_one_port(&serial_pxa_reg, &sport->port); + kfree(sport->name); clk_put(sport->clk); kfree(sport);And this must be removed now that sport->name is allocated as part of sport. Arnd
Ah. It's a bug. I'll fix it tomorrow. Thanks Haojian