From: David Brownell <david-b@pacbell.net>
To: Felipe Balbi <felipe.balbi@nokia.com>
Cc: linux-omap@vger.kernel.org, Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH 0/9] twl4030 updates
Date: Sat, 27 Sep 2008 12:14:29 -0700 [thread overview]
Message-ID: <200809271214.30165.david-b@pacbell.net> (raw)
In-Reply-To: <1222427996-7018-1-git-send-email-felipe.balbi@nokia.com>
Here are some more cleanups to consider including ... these
should apply on top of all nine patches.
======= SNIP HERE!
Provide detailed diagnostics in add_children() when DEBUG is
defined ... and fix the non-DEBUG message to include minimal
status, and not appear unless there was actually an error.
Update the IRQ message; have it match what the GPIO subchip
says, and as a precaution, make it only appear if the IRQs
have been initialized.
--- beagle.orig/drivers/i2c/chips/twl4030-core.c
+++ beagle/drivers/i2c/chips/twl4030-core.c
@@ -677,6 +677,9 @@ static int add_children(struct twl4030_p
status = platform_device_add_data(pdev, pdata->keypad,
sizeof(*pdata->keypad));
if (status < 0) {
+ dev_dbg(&twl->client->dev,
+ "can't add keypad data, %d\n",
+ status);
platform_device_put(pdev);
goto err;
}
@@ -684,6 +687,7 @@ static int add_children(struct twl4030_p
if (status < 0)
platform_device_put(pdev);
} else {
+ pr_debug("%s: can't alloc keypad dev\n", DRIVER_NAME);
status = -ENOMEM;
goto err;
}
@@ -693,8 +697,10 @@ static int add_children(struct twl4030_p
twl = &twl4030_modules[TWL4030_SLAVENUM_NUM1];
pdev = platform_device_alloc("twl4030_gpio", -1);
- if (!pdev)
+ if (!pdev) {
+ pr_debug("%s: can't alloc gpio dev\n", DRIVER_NAME);
status = -ENOMEM;
+ }
/* more driver model init */
if (status == 0) {
@@ -703,6 +709,10 @@ static int add_children(struct twl4030_p
status = platform_device_add_data(pdev, pdata->gpio,
sizeof(*pdata->gpio));
+ if (status < 0)
+ dev_dbg(&twl->client->dev,
+ "can't add gpio data, %d\n",
+ status);
}
/* GPIO module IRQ */
@@ -737,12 +747,16 @@ static int add_children(struct twl4030_p
sizeof(*pdata->madc));
if (status < 0) {
platform_device_put(pdev);
+ dev_dbg(&twl->client->dev,
+ "can't add madc data, %d\n",
+ status);
goto err;
}
status = platform_device_add(pdev);
if (status < 0)
platform_device_put(pdev);
} else {
+ pr_debug("%s: can't alloc madc dev\n", DRIVER_NAME);
status = -ENOMEM;
goto err;
}
@@ -788,19 +802,24 @@ static int add_children(struct twl4030_p
sizeof(*pdata->usb));
if (status < 0) {
platform_device_put(pdev);
+ dev_dbg(&twl->client->dev,
+ "can't add usb data, %d\n",
+ status);
goto err;
}
status = platform_device_add(pdev);
if (status < 0)
platform_device_put(pdev);
} else {
+ pr_debug("%s: can't alloc usb dev\n", DRIVER_NAME);
status = -ENOMEM;
goto err;
}
}
err:
- pr_err("failed to add twl4030's children\n");
+ if (status)
+ pr_err("failed to add twl4030's children (status %d)\n", status);
return status;
}
@@ -1084,13 +1103,12 @@ twl4030_probe(struct i2c_client *client,
&& twl4030_irq_base == 0
&& client->irq
&& pdata->irq_base
- && pdata->irq_end > pdata->irq_base)
+ && pdata->irq_end > pdata->irq_base) {
twl_init_irq(client->irq, pdata->irq_base, pdata->irq_end);
+ dev_info(&client->dev, "IRQ %d chains IRQs %d..%d\n",
+ client->irq, pdata->irq_base, pdata->irq_end - 1);
+ }
- dev_info(&client->dev, "chaining %d irqs\n",
- twl4030_irq_base
- ? (pdata->irq_end - pdata->irq_base)
- : 0);
return 0;
fail:
next prev parent reply other threads:[~2008-09-27 19:14 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-26 11:19 [PATCH 0/9] twl4030 updates Felipe Balbi
2008-09-26 11:19 ` [PATCH 1/9] twl4030: fix potential null pointer dereference Felipe Balbi
2008-09-26 11:19 ` [PATCH 2/9] twl4030-gpio: Remove default pullup enable/disable of GPIO Felipe Balbi
2008-09-26 11:19 ` [PATCH 3/9] i2c: clean add_children a bit Felipe Balbi
2008-09-26 11:19 ` [PATCH 4/9] i2c: move twl4030_keypad to new style registration Felipe Balbi
2008-09-26 11:19 ` [PATCH 5/9] i2c: move twl4030-usb to platform_device Felipe Balbi
2008-09-26 11:19 ` [PATCH 6/9] i2c: twl4030-usb: add 'vbus' sysfs file Felipe Balbi
2008-09-26 11:19 ` [PATCH 7/9] twl4030 gpio platform data Felipe Balbi
2008-09-26 11:19 ` [PATCH 8/9] twl4030 uses gpiolib Felipe Balbi
2008-09-26 11:19 ` [PATCH 9/9] i2c: move twl4030-madc to new registration style Felipe Balbi
2008-09-26 17:09 ` David Brownell
2008-09-26 17:46 ` Felipe Balbi
2008-09-27 7:37 ` Mikko Ylinen
2008-09-27 15:04 ` David Brownell
2008-09-27 15:40 ` Steve Sakoman
2008-09-27 17:17 ` David Brownell
2008-10-01 14:20 ` Mikko Ylinen
2008-10-01 16:13 ` David Brownell
2008-09-26 19:50 ` David Brownell
2008-09-26 20:01 ` Steve Sakoman
2008-09-26 17:10 ` [PATCH 8/9] twl4030 uses gpiolib David Brownell
2008-09-26 17:47 ` Felipe Balbi
2008-09-26 18:57 ` David Brownell
2008-09-28 1:01 ` [PATCH 5/9] i2c: move twl4030-usb to platform_device David Brownell
2008-09-28 3:03 ` Felipe Balbi
2008-09-26 17:12 ` [PATCH 0/9] twl4030 updates David Brownell
2008-09-26 17:50 ` Felipe Balbi
2008-09-26 18:55 ` David Brownell
2008-09-26 19:00 ` David Brownell
2008-09-26 19:10 ` Steve Sakoman
2008-09-26 19:23 ` Felipe Balbi
2008-09-26 19:45 ` David Brownell
2008-09-27 19:14 ` David Brownell [this message]
2008-09-27 21:17 ` Felipe Balbi
2008-09-27 21:45 ` David Brownell
2008-09-27 21:46 ` Felipe Balbi
2008-09-27 21:41 ` [PATCH 11/9] move twl4030-gpio to drivers/gpio David Brownell
2008-09-27 22:29 ` Felipe Balbi
2008-09-27 23:09 ` Felipe Balbi
2008-09-27 23:45 ` David Brownell
2008-09-28 3:14 ` Felipe Balbi
2008-09-28 5:16 ` David Brownell
2008-10-01 13:46 ` Felipe Contreras
2008-10-01 13:52 ` Felipe Balbi
2008-10-01 15:58 ` David Brownell
2008-10-01 16:05 ` Jean Delvare
2008-10-01 16:32 ` David Brownell
2008-09-27 23:29 ` David Brownell
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=200809271214.30165.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=felipe.balbi@nokia.com \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.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