From: Igor Grinberg <grinberg@compulab.co.il>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: "Tony Lindgren" <tony@atomide.com>,
"Russell King - ARM Linux" <linux@arm.linux.org.uk>,
linux-omap@vger.kernel.org,
"Santosh Shilimkar" <santosh.shilimkar@ti.com>,
"Cousson, Benoit" <b-cousson@ti.com>,
"Paul Walmsley" <paul@pwsan.com>, "Kevin Hilman" <khilman@ti.com>,
"Afzal Mohammed" <afzal@ti.com>,
"Péter Ujfalusi" <peter.ujfalusi@ti.com>
Subject: Re: Errors at boot time from OMAP4430SDP (and a whinge about serial stuff)
Date: Tue, 23 Oct 2012 09:37:49 +0200 [thread overview]
Message-ID: <5086494D.4080205@compulab.co.il> (raw)
In-Reply-To: <CAK=WgbbPmuOgssRRSinsV3rXg7TUa9fpOP-Zg+VatZgqgVYixw@mail.gmail.com>
On 10/21/12 16:54, Ohad Ben-Cohen wrote:
> On Fri, Oct 19, 2012 at 7:07 PM, Tony Lindgren <tony@atomide.com> wrote:
> ...
>> We could optimize away a minimal amount of code for many configurations
>> with the ifdef? :)
>
> Sure, here goes (compile tested only):
>
>>From 6b82365da2c04986e647d06c285197efece7cb34 Mon Sep 17 00:00:00 2001
> From: Ohad Ben-Cohen <ohad@wizery.com>
> Date: Sun, 14 Oct 2012 20:16:01 +0200
> Subject: [PATCH] ARM: OMAP: don't print any error when wl12xx isn't
> configured
>
> Stop intimidating users with scary wlan error messages in case wl12xx
> support wasn't even built.
>
> In addition, when wl12xx_set_platform_data() fails, don't bother
> registering wl12xx's fixed regulator device (on the relevant
> boards).
>
> While we're at it, extract the wlan init code to a dedicated function to
> make (the relevant boards') init code look a bit nicer.
>
> Compile tested only.
>
> Reported-by: Russell King <linux@arm.linux.org.uk>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Apart, from the minor comment below,
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
> arch/arm/mach-davinci/board-da850-evm.c | 8 ++-----
> arch/arm/mach-omap2/board-4430sdp.c | 7 +++---
> arch/arm/mach-omap2/board-omap3evm.c | 6 ++---
> arch/arm/mach-omap2/board-omap3pandora.c | 9 +++-----
> arch/arm/mach-omap2/board-omap4panda.c | 20 ++++++++++++-----
> arch/arm/mach-omap2/board-zoom-peripherals.c | 15 ++++++++-----
> arch/arm/mach-omap2/common-board-devices.c | 33 ++++++++++++++++++++++++++++
> arch/arm/mach-omap2/common-board-devices.h | 2 ++
> 8 files changed, 71 insertions(+), 29 deletions(-)
[...]
> diff --git a/arch/arm/mach-omap2/common-board-devices.c
> b/arch/arm/mach-omap2/common-board-devices.c
> index 48daac2..02351e9 100644
> --- a/arch/arm/mach-omap2/common-board-devices.c
> +++ b/arch/arm/mach-omap2/common-board-devices.c
> @@ -23,6 +23,7 @@
> #include <linux/gpio.h>
> #include <linux/spi/spi.h>
> #include <linux/spi/ads7846.h>
> +#include <linux/wl12xx.h>
>
> #include <linux/platform_data/spi-omap2-mcspi.h>
> #include <linux/platform_data/mtd-nand-omap2.h>
> @@ -141,3 +142,35 @@ void __init omap_nand_flash_init(int options,
> struct mtd_partition *parts,
> {
> }
> #endif
> +
> +#ifdef CONFIG_WL12XX_PLATFORM_DATA
> +int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
> +{
> + int ret;
> +
> + wlan_data->irq = gpio_to_irq(gpio);
> + if (wlan_data->irq < 0) {
> + ret = wlan_data->irq;
> + pr_err("wl12xx: gpio_to_irq(%d) failed: %d\n", gpio, ret);
> + return ret;
> + }
> +
> + ret = wl12xx_set_platform_data(wlan_data);
> + /* bail out silently in case wl12xx isn't configured */
> + if (ret == -ENOSYS)
> + return ret;
Since we have the function ifdef'ed, I don't think we need
the ENOSYS check, do we?
> +
> + /* bail out verbosely on any other error */
> + if (ret) {
> + pr_err("error setting wl12xx data: %d\n", ret);
> + return ret;
> + }
> +
> + return 0;
> +}
> +#else /* !CONFIG_WL12XX_PLATFORM_DATA */
> +int __init wl12xx_board_init(struct wl12xx_platform_data *wlan_data, int gpio)
> +{
> + return 0;
> +}
> +#endif
[...]
--
Regards,
Igor.
next prev parent reply other threads:[~2012-10-23 7:37 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-12 15:54 Errors at boot time from OMAP4430SDP (and a whinge about serial stuff) Russell King - ARM Linux
2012-10-12 16:24 ` Tony Lindgren
2012-10-12 16:31 ` Russell King - ARM Linux
2012-10-12 16:34 ` Benoit Cousson
2012-10-12 16:56 ` Tony Lindgren
2012-10-12 18:47 ` Kevin Hilman
2012-10-14 18:30 ` Ohad Ben-Cohen
2012-10-16 18:10 ` Tony Lindgren
2012-10-16 18:26 ` Tony Lindgren
2012-10-17 9:10 ` Ohad Ben-Cohen
2012-10-17 12:43 ` Igor Grinberg
2012-10-18 16:58 ` Ohad Ben-Cohen
2012-10-19 17:07 ` Tony Lindgren
2012-10-21 14:54 ` Ohad Ben-Cohen
2012-10-23 7:37 ` Igor Grinberg [this message]
2012-10-23 7:51 ` Ohad Ben-Cohen
2012-10-23 9:46 ` Igor Grinberg
2012-10-24 1:54 ` Tony Lindgren
2012-10-24 11:15 ` Ohad Ben-Cohen
2012-10-25 19:03 ` Tony Lindgren
2012-10-15 5:54 ` Mohammed, Afzal
2012-10-16 18:12 ` Tony Lindgren
2012-10-16 19:24 ` Benoit Cousson
2012-10-16 19:53 ` Tony Lindgren
2012-10-15 7:37 ` Péter Ujfalusi
2012-10-23 10:10 ` Russell King - ARM Linux
2012-10-25 1:09 ` Tony Lindgren
2012-10-25 16:05 ` Balaji T K
2012-10-25 17:24 ` Kevin Hilman
2012-10-25 17:38 ` Kevin Hilman
2012-10-25 17:46 ` Tony Lindgren
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=5086494D.4080205@compulab.co.il \
--to=grinberg@compulab.co.il \
--cc=afzal@ti.com \
--cc=b-cousson@ti.com \
--cc=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=ohad@wizery.com \
--cc=paul@pwsan.com \
--cc=peter.ujfalusi@ti.com \
--cc=santosh.shilimkar@ti.com \
--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;
as well as URLs for NNTP newsgroup(s).