From: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Jean Delvare (PC drivers,
core)" <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Linus Walleij
<linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>,
"Ben Dooks (embedded platforms)"
<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
Date: Mon, 13 Sep 2010 20:56:44 +0100 [thread overview]
Message-ID: <20100913195644.GC3819@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <b0c83cb1b42c6adf38f6322066fb457693f7ac3b.1284406638.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
On Mon, Sep 13, 2010 at 12:47:43PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-stu300.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
> struct resource *res;
> int bus_nr;
> int ret = 0;
> - char clk_name[] = "I2C0";
> + char clk_name[sizeof("I2Cx")];
>
> dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
> if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> }
>
> bus_nr = pdev->id;
> - clk_name[3] += (char)bus_nr;
> + sprintf(clk_name, "I2C%c", '0' + bus_nr);
If people would implement the clk API correctly (matching by struct device
rather than giving every clock a name and trying to use the const char *
as the sole matching token), stuff like this would not be necessary.
The second argument to clk_get() is supposed to be a _consumer_ name
(iow, something to determine which clock for the struct device you want)
rather than a producer name.
next prev parent reply other threads:[~2010-09-13 19:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
[not found] ` <cover.1284406638.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2010-09-13 19:47 ` [PATCH 05/25] drivers/i2c: " Joe Perches
[not found] ` <b0c83cb1b42c6adf38f6322066fb457693f7ac3b.1284406638.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2010-09-13 19:56 ` Russell King - ARM Linux [this message]
2010-09-13 20:08 ` Jonathan Cameron
[not found] ` <4C8E84A0.1010606-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>
2010-09-13 20:16 ` Joe Perches
2010-09-14 7:36 ` Lothar Waßmann
[not found] ` <19599.9719.562406.692216-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
2010-09-14 12:57 ` Jonathan Cameron
[not found] ` <4C8F7157.9060005-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>
2010-09-14 19:48 ` Russell King - ARM Linux
2010-09-14 23:23 ` Ben Dooks
2010-09-14 9:14 ` (unknown) David Howells
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=20100913195644.GC3819@n2100.arm.linux.org.uk \
--to=linux-lfz/pmaqli7xmaaqvzeohq@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).