From: pavel@ucw.cz (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: GPIO support for HTC Dream
Date: Wed, 9 Dec 2009 12:46:07 +0100 [thread overview]
Message-ID: <20091209114607.GE22752@elf.ucw.cz> (raw)
In-Reply-To: <1260309812.27677.117.camel@Joe-Laptop.home>
On Tue 2009-12-08 14:03:32, Joe Perches wrote:
> On Tue, 2009-12-08 at 22:46 +0100, Pavel Machek wrote:
> > Add GPIO support for HTC Dream.
>
> Hi Pavel. Thanks for this.
>
> Maybe it'd be nicer to use pr_<level> and add
> #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
> ?
It included names of functions, anyway, so agreed. Incremental patch:
(I'll fold them all and resubmit).
diff --git a/arch/arm/mach-msm/board-dream-gpio.c b/arch/arm/mach-msm/board-dream-gpio.c
index d9201f9..221c3bd 100644
--- a/arch/arm/mach-msm/board-dream-gpio.c
+++ b/arch/arm/mach-msm/board-dream-gpio.c
@@ -30,6 +30,8 @@
#undef MODULE_PARAM_PREFIX
#define MODULE_PARAM_PREFIX "board_trout."
+#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
+
static uint cpld_usb_h2w_sw;
module_param_named(usb_h2w_sw, cpld_usb_h2w_sw, uint, 0);
@@ -83,7 +85,7 @@ static int dream_gpio_write(struct gpio_chip *chip, unsigned n, unsigned on)
uint8_t reg_val;
if ((reg >> 1) >= ARRAY_SIZE(dream_cpld_shadow)) {
- printk(KERN_ERR "dream_gpio_write called on input %d\n", n);
+ pr_err("called on input %d\n", n);
return -ENOTSUPP;
}
@@ -186,7 +188,7 @@ static void dream_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
if (v & int_mask) {
writeb(v & int_mask, DREAM_CPLD_BASE + stat_reg);
- printk(KERN_ERR "dream_gpio_irq_handler: got masked "
+ pr_err("got masked "
"interrupt: %d:%02x\n", bank, v & int_mask);
}
diff --git a/arch/arm/mach-msm/generic_gpio.c b/arch/arm/mach-msm/generic_gpio.c
index 5164c77..1175ffd 100644
--- a/arch/arm/mach-msm/generic_gpio.c
+++ b/arch/arm/mach-msm/generic_gpio.c
@@ -22,6 +22,8 @@
#include "gpio_chip.h"
+#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
+
#define GPIO_NUM_TO_CHIP_INDEX(gpio) ((gpio)>>5)
struct gpio_state {
@@ -47,7 +49,7 @@ int register_gpio_chip(struct gpio_chip *new_gpio_chip)
new_gpio_chip->state = kzalloc(size, GFP_KERNEL);
if (new_gpio_chip->state == NULL) {
- printk(KERN_ERR "register_gpio_chip: failed to allocate state\n");
+ pr_err("failed to allocate state\n");
return -ENOMEM;
}
@@ -63,7 +65,7 @@ int register_gpio_chip(struct gpio_chip *new_gpio_chip)
new_array = kmalloc(array_size * sizeof(new_array[0]), GFP_ATOMIC);
if (!new_array) {
- printk(KERN_ERR "register_gpio_chip: failed to allocate array\n");
+ pr_err("failed to allocate array\n");
err = -ENOMEM;
goto failed;
}
@@ -81,7 +83,7 @@ int register_gpio_chip(struct gpio_chip *new_gpio_chip)
goto added;
}
if (gpio_chip->end >= new_gpio_chip->start) {
- printk(KERN_ERR "register_gpio_source %u-%u overlaps with %u-%u\n",
+ pr_err("%u-%u overlaps with %u-%u\n",
new_gpio_chip->start, new_gpio_chip->end,
gpio_chip->start, gpio_chip->end);
err = -EBUSY;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2009-12-09 11:46 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-08 10:28 GPIO support for HTC Dream Pavel Machek
2009-12-08 20:22 ` Ryan Mallon
2009-12-08 21:37 ` Pavel Machek
2009-12-08 21:53 ` Ryan Mallon
2009-12-10 16:26 ` Pavel Machek
2009-12-08 21:56 ` Arve Hjønnevåg
2009-12-09 11:32 ` Pavel Machek
2009-12-08 21:46 ` Pavel Machek
2009-12-08 22:03 ` Joe Perches
2009-12-09 11:46 ` Pavel Machek [this message]
2009-12-08 22:10 ` Ryan Mallon
2009-12-09 23:40 ` Ryan Mallon
2009-12-10 17:24 ` Pavel Machek
2009-12-10 17:41 ` Mark Brown
2009-12-10 19:49 ` Ryan Mallon
2009-12-10 23:14 ` H Hartley Sweeten
2009-12-11 19:58 ` Pavel Machek
2009-12-11 22:10 ` Pavel Machek
2009-12-11 22:40 ` Arve Hjønnevåg
2009-12-11 23:12 ` H Hartley Sweeten
2009-12-16 22:53 ` Pavel Machek
2009-12-16 23:03 ` Daniel Walker
2009-12-11 23:04 ` H Hartley Sweeten
2009-12-14 6:45 ` Pavel Machek
2009-12-14 17:54 ` Daniel Walker
2009-12-14 18:12 ` H Hartley Sweeten
2009-12-15 6:40 ` Arve Hjønnevåg
2009-12-15 19:12 ` Pavel Machek
2009-12-15 20:07 ` Daniel Walker
2009-12-15 21:21 ` Pavel Machek
2009-12-15 20:48 ` Jamie Lokier
2009-12-15 21:07 ` Brian Swetland
2009-12-14 19:00 ` H Hartley Sweeten
2009-12-15 19:47 ` Pavel Machek
2009-12-15 20:15 ` H Hartley Sweeten
2009-12-15 20:47 ` Pavel Machek
2009-12-15 21:16 ` [patch] " Pavel Machek
2009-12-25 17:10 ` Pavel Machek
2009-12-25 23:49 ` Daniel Walker
2009-12-26 8:51 ` Pavel Machek
2009-12-15 20:24 ` Ryan Mallon
2009-12-15 20:44 ` Pavel Machek
2009-12-15 6:48 ` Arve Hjønnevåg
2009-12-11 23:28 ` Russell King - ARM Linux
2009-12-11 23:50 ` H Hartley Sweeten
2009-12-14 6:24 ` Pavel Machek
2009-12-10 16:57 ` Pavel Machek
2009-12-08 22:45 ` Russell King - ARM Linux
2009-12-09 0:39 ` Arve Hjønnevåg
2009-12-09 11:37 ` Pavel Machek
2009-12-09 11:42 ` Arve Hjønnevåg
2009-12-10 16:27 ` Pavel Machek
2009-12-09 16:18 ` Daniel Walker
2009-12-13 21:29 ` Pavel Machek
2009-12-13 21:38 ` Brian Swetland
2009-12-15 19:09 ` Pavel Machek
2009-12-14 17:40 ` Daniel Walker
2009-12-15 19:10 ` Pavel Machek
2009-12-09 11:41 ` Pavel Machek
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=20091209114607.GE22752@elf.ucw.cz \
--to=pavel@ucw.cz \
--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 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).