linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] powerpc: fix i2c device string format
Date: Wed, 15 Aug 2007 16:29:02 -0500	[thread overview]
Message-ID: <46C3701E.3090205@freescale.com> (raw)
In-Reply-To: <Pine.LNX.4.60.0708152106090.10160@poirot.grange>

Guennadi Liakhovetski wrote:
> diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
> index 727453d..c0d66df 100644
> --- a/arch/powerpc/sysdev/fsl_soc.c
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -320,21 +320,26 @@ static struct i2c_driver_device i2c_devices[] __initdata = {
>  	{"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
>  };
>  
> -static int __init of_find_i2c_driver(struct device_node *node, struct i2c_board_info *info)
> +static int __init of_find_i2c_driver(struct device_node *node,
> +				     struct i2c_board_info *info)
>  {
>  	int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
>  		if (!of_device_is_compatible(node, i2c_devices[i].of_device))
>  			continue;
> -		strncpy(info->driver_name, i2c_devices[i].i2c_driver, KOBJ_NAME_LEN);
> -		strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE);
> +		if (strlcpy(info->driver_name, i2c_devices[i].i2c_driver,
> +			    KOBJ_NAME_LEN) >= KOBJ_NAME_LEN ||
> +		    strlcpy(info->type, i2c_devices[i].i2c_type,
> +			    I2C_NAME_SIZE) >= I2C_NAME_SIZE)
> +			return -ENOMEM;
>  		return 0;
>  	}
>  	return -ENODEV;
>  }

BTW, is there any reason this stuff is fsl_soc specific?  I'd think 
prom_parse.c (or better yet, drivers/of/ or drivers/i2c/, now that some 
OF calls have been factored out) would be a better place.

-Scott

  reply	other threads:[~2007-08-15 21:29 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 19:20 [PATCH] powerpc: Add of_register_i2c_devices() Guennadi Liakhovetski
2007-07-01 23:36 ` Kumar Gala
2007-07-02 11:56   ` Segher Boessenkool
2007-07-02 12:03 ` Segher Boessenkool
2007-07-02 20:11   ` Guennadi Liakhovetski
2007-07-02 22:46     ` Scott Wood
2007-07-02 23:10       ` Segher Boessenkool
2007-07-02 23:06     ` Segher Boessenkool
2007-07-03 22:34       ` Guennadi Liakhovetski
2007-07-03 23:02         ` Segher Boessenkool
2007-07-04  5:28           ` Guennadi Liakhovetski
2007-07-04 12:19             ` Segher Boessenkool
2007-07-04 17:50               ` Guennadi Liakhovetski
2007-07-17 22:17           ` Guennadi Liakhovetski
2007-07-19 15:32             ` Segher Boessenkool
2007-07-19 22:07               ` Guennadi Liakhovetski
2007-07-20  7:26                 ` Segher Boessenkool
2007-07-20 20:26                   ` Guennadi Liakhovetski
2007-07-31 22:55                     ` Segher Boessenkool
2007-08-01  5:41                       ` Guennadi Liakhovetski
2007-08-01  8:18                         ` Segher Boessenkool
2007-08-01 20:36                           ` Guennadi Liakhovetski
2007-08-01 20:42                             ` Scott Wood
2007-08-07 22:32                               ` [PATCH] powerpc: fix i2c device string format Guennadi Liakhovetski
2007-08-09 19:45                                 ` Segher Boessenkool
2007-08-09 20:46                                   ` Guennadi Liakhovetski
2007-08-10 17:44                                     ` Segher Boessenkool
2007-08-15  6:23                                     ` Paul Mackerras
2007-08-15 19:15                                       ` Guennadi Liakhovetski
2007-08-15 21:29                                         ` Scott Wood [this message]
2007-08-15 22:23                                           ` Guennadi Liakhovetski
2007-08-16  0:36                                         ` Stephen Rothwell
2007-07-03  0:42   ` [PATCH] powerpc: Add of_register_i2c_devices() Benjamin Herrenschmidt
2007-07-03 12:33     ` Segher Boessenkool

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=46C3701E.3090205@freescale.com \
    --to=scottwood@freescale.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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 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).