All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/7] serial: pxa: add OF support
Date: Mon, 5 Mar 2012 12:55:37 +0000	[thread overview]
Message-ID: <201203051255.37311.arnd@arndb.de> (raw)
In-Reply-To: <1330950111-30797-2-git-send-email-haojian.zhuang@marvell.com>

On Monday 05 March 2012, Haojian Zhuang wrote:

>  
> +#define PXA_NAME_LEN		8
> +
>  struct uart_pxa_port {
>  	struct uart_port        port;
>  	unsigned char           ier;

Why didn't you just add a field here with that length?

> @@ -781,6 +784,39 @@ static const struct dev_pm_ops serial_pxa_pm_ops = {
>  };
>  #endif
>  
> +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);

This one should have an #ifdef CONFIG_OF

> +#ifdef CONFIG_OF
> +static int serial_pxa_probe_dt(struct platform_device *pdev,
> +			       struct uart_pxa_port *sport)
> +{

While this one does not need it: it will already compile to nothing
if you check the error value correctly.

> +	sport->name = kzalloc(PXA_NAME_LEN, GFP_KERNEL);
> +	if (!sport->name) {
> +		ret = -ENOMEM;
> +		goto err_clk;
>  	}

No need for this allocation if you put the name into uart_pxa_port
as a member instead of a pointer.

> +		.of_match_table = serial_pxa_dt_ids,
>  	},
>  };

		.of_match_table = of_match_ptr(serial_pxa_dt_ids),

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Haojian Zhuang <haojian.zhuang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
Cc: eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v2 1/7] serial: pxa: add OF support
Date: Mon, 5 Mar 2012 12:55:37 +0000	[thread overview]
Message-ID: <201203051255.37311.arnd@arndb.de> (raw)
In-Reply-To: <1330950111-30797-2-git-send-email-haojian.zhuang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>

On Monday 05 March 2012, Haojian Zhuang wrote:

>  
> +#define PXA_NAME_LEN		8
> +
>  struct uart_pxa_port {
>  	struct uart_port        port;
>  	unsigned char           ier;

Why didn't you just add a field here with that length?

> @@ -781,6 +784,39 @@ static const struct dev_pm_ops serial_pxa_pm_ops = {
>  };
>  #endif
>  
> +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);

This one should have an #ifdef CONFIG_OF

> +#ifdef CONFIG_OF
> +static int serial_pxa_probe_dt(struct platform_device *pdev,
> +			       struct uart_pxa_port *sport)
> +{

While this one does not need it: it will already compile to nothing
if you check the error value correctly.

> +	sport->name = kzalloc(PXA_NAME_LEN, GFP_KERNEL);
> +	if (!sport->name) {
> +		ret = -ENOMEM;
> +		goto err_clk;
>  	}

No need for this allocation if you put the name into uart_pxa_port
as a member instead of a pointer.

> +		.of_match_table = serial_pxa_dt_ids,
>  	},
>  };

		.of_match_table = of_match_ptr(serial_pxa_dt_ids),

	Arnd

  reply	other threads:[~2012-03-05 12:55 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 12:21 [PATCH v2 0/7] ARM: mmp: support OF on pxa168 Haojian Zhuang
2012-03-05 12:21 ` Haojian Zhuang
2012-03-05 12:21 ` [PATCH v2 1/7] serial: pxa: add OF support Haojian Zhuang
2012-03-05 12:21   ` Haojian Zhuang
2012-03-05 12:55   ` Arnd Bergmann [this message]
2012-03-05 12:55     ` Arnd Bergmann
2012-03-05 14:03     ` Haojian Zhuang
2012-03-05 14:03       ` Haojian Zhuang
2012-03-06  2:42     ` [PATCH v3 " Haojian Zhuang
2012-03-06  2:42       ` Haojian Zhuang
2012-03-06 15:02       ` Arnd Bergmann
2012-03-06 15:02         ` Arnd Bergmann
2012-03-06 15:04         ` Haojian Zhuang
2012-03-06 15:04           ` Haojian Zhuang
2012-03-07  1:42         ` [PATCH v3 1/6] " Haojian Zhuang
2012-03-07  1:42           ` Haojian Zhuang
2012-03-07  7:58           ` Arnd Bergmann
2012-03-07  7:58             ` Arnd Bergmann
2012-03-09 15:24   ` [PATCH v2 1/7] " Grant Likely
2012-03-09 15:24     ` Grant Likely
2012-04-03 15:45   ` Grant Likely
2012-04-03 15:45     ` Grant Likely
2012-03-05 12:21 ` [PATCH v2 2/7] rtc: sa1100: " Haojian Zhuang
2012-03-05 12:21   ` Haojian Zhuang
2012-03-05 14:41   ` Arnd Bergmann
2012-03-05 14:41     ` Arnd Bergmann
2012-03-05 12:21 ` [PATCH v2 3/7] i2c: pxa: " Haojian Zhuang
2012-03-05 12:21   ` Haojian Zhuang
2012-03-05 14:41   ` Arnd Bergmann
2012-03-05 14:41     ` Arnd Bergmann
2012-03-05 12:21 ` [PATCH v2 4/7] ARM: mmp: enable rtc clk in pxa168 Haojian Zhuang
2012-03-05 12:21   ` Haojian Zhuang
2012-03-05 14:38   ` Arnd Bergmann
2012-03-05 14:38     ` Arnd Bergmann
2012-03-05 12:21 ` [PATCH v2 5/7] ARM: mmp: append OF support on pxa168 Haojian Zhuang
2012-03-05 12:21   ` Haojian Zhuang
2012-03-05 14:37   ` Arnd Bergmann
2012-03-05 14:37     ` Arnd Bergmann
2012-04-09  1:36   ` Chris Ball
2012-04-09  1:36     ` Chris Ball
2012-04-09  1:46     ` Haojian Zhuang
2012-04-09  1:46       ` Haojian Zhuang
2012-04-09  1:51       ` Chris Ball
2012-04-09  1:51         ` Chris Ball
2012-04-09  2:04         ` Haojian Zhuang
2012-04-09  2:04           ` Haojian Zhuang
2012-04-09  1:43   ` Chris Ball
2012-04-09  1:43     ` Chris Ball
2012-04-09  1:47     ` Haojian Zhuang
2012-04-09  1:47       ` Haojian Zhuang
2012-03-05 12:21 ` [PATCH v2 6/7] ARM: dts: append DTS file of pxa168 Haojian Zhuang
2012-03-05 12:21   ` Haojian Zhuang
2012-03-05 14:35   ` Arnd Bergmann
2012-03-05 14:35     ` Arnd Bergmann
2012-03-05 12:21 ` [PATCH v2 7/7] Document: devicetree: add OF documents for arch-mmp Haojian Zhuang
2012-03-05 12:21   ` Haojian Zhuang
2012-03-05 14:46   ` Arnd Bergmann
2012-03-05 14:46     ` Arnd Bergmann
2012-03-05 15:07     ` Rob Herring
2012-03-05 15:07       ` Rob Herring
2012-03-05 15:08     ` Cousson, Benoit
2012-03-05 15:08       ` Cousson, Benoit
2012-04-02 23:21   ` Mitch Bradley
2012-04-02 23:21     ` Mitch Bradley

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=201203051255.37311.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.