linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Sergei Ianovich <ynvich@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Russell King <linux@arm.linux.org.uk>,
	Jiri Slaby <jslaby@suse.cz>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <rob.herring@calxeda.com>,
	James Cameron <quozl@laptop.org>, Zhou Zhu <zzhu3@marvell.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND..." <devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 01/21 resend] serial: rewrite pxa2xx-uart to use 8250_core
Date: Thu, 19 Dec 2013 10:51:45 +0200	[thread overview]
Message-ID: <20131219085145.GB20686@xps8300> (raw)
In-Reply-To: <1387309071-22382-2-git-send-email-ynvich@gmail.com>

Hi Sergei,

I noticed one more thing. I'm sorry about commenting this late.

On Tue, Dec 17, 2013 at 11:37:31PM +0400, Sergei Ianovich wrote:
> +static int serial_pxa_probe(struct platform_device *pdev)
> +{
> +	struct uart_8250_port uart = {};
> +	struct pxa8250_data *data;
> +	struct resource *mmres, *irqres;
> +	int ret;
> +
> +	mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	irqres = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> +	if (!mmres || !irqres)
> +		return -ENODEV;
> +
> +	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
> +	if (!data)
> +		return -ENOMEM;
> +
> +	data->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(data->clk))
> +		return PTR_ERR(data->clk);
> +
> +	ret = clk_prepare(data->clk);
> +	if (ret)
> +		return ret;
> +
> +	uart.port.type = PORT_XSCALE;
> +	uart.port.iotype = UPIO_MEM32;
> +	uart.port.mapbase = mmres->start;
> +	uart.port.regshift = 2;
> +	uart.port.irq = irqres->start;
> +	uart.port.fifosize = 64;
> +	uart.port.flags = UPF_IOREMAP | UPF_SKIP_TEST;

Since you set the type PORT_XSCALE, don's you want to use
UPF_FIXED_TYPE flag instead of the UPF_SKIP_TEST here? Otherwise the
type will just get overridden and autoconfig() will be executed.

I'm guessing you also want to prevent things like the irq and the
uartclk from being changed by anybody by using the flag
UPF_FIXED_PORT, right?

> +	uart.port.dev = &pdev->dev;
> +	uart.port.uartclk = clk_get_rate(data->clk);
> +	uart.port.pm = serial_pxa_pm;
> +	uart.port.private_data = data;
> +	uart.dl_write = serial_pxa_dl_write;
> +
> +	ret = serial8250_register_8250_port(&uart);
> +	if (ret < 0)
> +		goto err_clk;
> +
> +	data->line = ret;
> +
> +	platform_set_drvdata(pdev, data);
> +
> +	return 0;
> +
> + err_clk:
> +	clk_unprepare(data->clk);
> +	return ret;
> +}

-- 
heikki

  parent reply	other threads:[~2013-12-19  8:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1386543229-1542-1-git-send-email-ynvich@gmail.com>
     [not found] ` <1386901645-28895-1-git-send-email-ynvich@gmail.com>
2013-12-13  2:27   ` [PATCH v2 10/16] serial: support for 16550A serial ports on LP-8x4x Sergei Ianovich
     [not found]   ` <1387309071-22382-1-git-send-email-ynvich@gmail.com>
2013-12-17 19:37     ` [PATCH v3 01/21 resend] serial: rewrite pxa2xx-uart to use 8250_core Sergei Ianovich
2013-12-18 23:55       ` Greg Kroah-Hartman
2013-12-19  8:51       ` Heikki Krogerus [this message]
2013-12-19  9:35         ` Sergei Ianovich
2013-12-19 10:01           ` Sergei Ianovich
2013-12-19 11:05             ` Heikki Krogerus
2013-12-17 19:37     ` [PATCH v3 12/21] serial: support for 16550A serial ports on LP-8x4x Sergei Ianovich
2013-12-19 11:18       ` Heikki Krogerus
     [not found]     ` <1397668411-27162-1-git-send-email-ynvich@gmail.com>
2014-04-16 17:13       ` [PATCH v4 01/21] serial: rewrite pxa2xx-uart to use 8250_core Sergei Ianovich
2015-01-19 18:08         ` Rob Herring
     [not found]     ` <1449700088-28076-1-git-send-email-ynvich@gmail.com>
2015-12-09 22:28       ` [PATCH v4 1/2] " Sergei Ianovich
2015-12-19 12:45         ` Robert Jarzmik
2015-12-19 13:26           ` Robert Jarzmik
2015-12-19 18:46             ` Sergei Ianovich
2015-12-19 19:31               ` Robert Jarzmik
2015-12-19 20:12                 ` Sergei Ianovich
2015-12-19 23:12                   ` Robert Jarzmik
2015-12-20 11:24                     ` Sergei Ianovich
2015-12-22 19:27                       ` Robert Jarzmik
2015-12-23 18:59         ` [PATCH v5] " Sergei Ianovich
2015-12-23 22:50           ` kbuild test robot
2015-12-24 15:15           ` [PATCH v6] " Sergei Ianovich
2015-12-29 11:06             ` Heikki Krogerus
2015-12-29 16:50               ` Robert Jarzmik
2016-02-07  6:22             ` Greg Kroah-Hartman
2016-02-22  1:56               ` Sergei Ianovich
2016-02-22  7:17                 ` Robert Jarzmik
2016-09-27 15:47                   ` Robert Jarzmik
2016-09-27 16:12                     ` Greg Kroah-Hartman
2016-09-27 16:24                       ` Robert Jarzmik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131219085145.GB20686@xps8300 \
    --to=heikki.krogerus@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=quozl@laptop.org \
    --cc=rob.herring@calxeda.com \
    --cc=ynvich@gmail.com \
    --cc=zzhu3@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).