From patchwork Sun Oct 14 18:30:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 1591441 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6D96640ABA for ; Sun, 14 Oct 2012 18:31:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753320Ab2JNSa4 (ORCPT ); Sun, 14 Oct 2012 14:30:56 -0400 Received: from mail-vb0-f46.google.com ([209.85.212.46]:45880 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915Ab2JNSaz (ORCPT ); Sun, 14 Oct 2012 14:30:55 -0400 Received: by mail-vb0-f46.google.com with SMTP id ff1so4510044vbb.19 for ; Sun, 14 Oct 2012 11:30:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:x-gm-message-state; bh=jzf2YUgorlbzsairTSvbS8reFxfzzQBo3HOcLZnbjFE=; b=Chn87TjOXS/DHBPcDDQH4Mtb6WHmRW1WQxdhmIEh3Z0yRba0IRQvdCrMyaMoJ5A9PI iTASX8MT5z+2uQkAlvUPGM4YfZ3he4BIFinmwLQUuVpHcMY1wCsNX/4/FKPOCWfUhoBJ R0+RkMigsCT8D1qfu07lJAkQuZIcL6fYdWqDoiQZ+fujRIic0yrQjLxYV5R2HQl2Zdkn 9Jo/7G8c88JoTxLjEOjq9dvAJKtaroN53c9OuQsLxo9deKnczhBYgsob+NoNEr3zm3Z/ V1OhqOqlg5A5nGRREoCCrg+b1yWvnIT9OKh26jKInn3NLbylD/KFFEOFv/JHoGe2tKoW Z8pA== Received: by 10.52.179.231 with SMTP id dj7mr4487058vdc.108.1350239454432; Sun, 14 Oct 2012 11:30:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.113.170 with HTTP; Sun, 14 Oct 2012 11:30:33 -0700 (PDT) X-Originating-IP: [93.172.255.235] In-Reply-To: <20121012162452.GD30339@atomide.com> References: <20121012155434.GO28061@n2100.arm.linux.org.uk> <20121012162452.GD30339@atomide.com> From: Ohad Ben-Cohen Date: Sun, 14 Oct 2012 20:30:33 +0200 Message-ID: Subject: Re: Errors at boot time from OMAP4430SDP (and a whinge about serial stuff) To: Tony Lindgren Cc: Russell King - ARM Linux , linux-omap@vger.kernel.org, Santosh Shilimkar , "Cousson, Benoit" , Paul Walmsley , Kevin Hilman , Afzal Mohammed , =?ISO-8859-1?Q?P=E9ter_Ujfalusi?= X-Gm-Message-State: ALoCoQlllBZcwYYRLDbO3KJ4MWXdpmOCbW7Mu21ZoO9X3DjnikWyjQEA8BuBuX3tvzwnQ7SFqqBD Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org On Fri, Oct 12, 2012 at 6:24 PM, Tony Lindgren wrote: >> Error setting wl12xx data: -38 .. > Ohad, can you please take a look? Sure, -38 is -ENOSYS which is returned when the wl12xx driver isn't configured. This isn't an error (it's a user decision, and it shouldn't elicit any error) and the patch below (also attached) should make it go away on: From 374f145568585c8d6a8d5e4b8b5d3e6baedd2f39 Mon Sep 17 00:00:00 2001 From: Ohad Ben-Cohen 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. Reported-by: Russell King Signed-off-by: Ohad Ben-Cohen --- arch/arm/mach-davinci/board-da850-evm.c | 7 ++++++- arch/arm/mach-omap2/board-4430sdp.c | 13 ++++++++++-- arch/arm/mach-omap2/board-omap3evm.c | 11 +++++++++- arch/arm/mach-omap2/board-omap3pandora.c | 9 ++++++++- arch/arm/mach-omap2/board-omap4panda.c | 30 ++++++++++++++++++++++------ arch/arm/mach-omap2/board-zoom-peripherals.c | 20 ++++++++++++++++--- 6 files changed, 76 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 32ee3f8..1b19415 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -1404,8 +1404,13 @@ static __init int da850_wl12xx_init(void) da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ); ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data); + /* bail out silently in case wl12xx isn't configured */ + if (ret == -ENOSYS) + goto free_wlan_irq; + + /* bail out verbosely on any other error */ if (ret) { - pr_err("Could not set wl12xx data: %d\n", ret); + pr_err("error setting wl12xx data: %d\n", ret); goto free_wlan_irq; } diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 3669c12..d1dd81a 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -826,9 +826,18 @@ static void __init omap4_sdp4430_wifi_init(void) omap4_sdp4430_wifi_mux_init(); omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ); + ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data); - if (ret) - pr_err("Error setting wl12xx data: %d\n", ret); + /* bail out silently in case wl12xx isn't configured */ + if (ret == -ENOSYS) + return; + + /* bail out verbosely on any other error */ + if (ret) { + pr_err("error setting wl12xx data: %d\n", ret); + return; + } + ret = platform_device_register(&omap_vwlan_device); if (ret) pr_err("Error registering wl12xx device: %d\n", ret); diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index b9b776b..7f72e44 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -637,9 +637,18 @@ static void __init omap3_evm_wl12xx_init(void) /* WL12xx WLAN Init */ omap3evm_wlan_data.irq = gpio_to_irq(OMAP3EVM_WLAN_IRQ_GPIO); + ret = wl12xx_set_platform_data(&omap3evm_wlan_data); - if (ret) + /* bail out silently in case wl12xx isn't configured */ + if (ret == -ENOSYS) + return; + + /* bail out verbosely on any other error */ + if (ret) { pr_err("error setting wl12xx data: %d\n", ret); + return; + } + ret = platform_device_register(&omap3evm_wlan_regulator); if (ret) pr_err("error registering wl12xx device: %d\n", ret); diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 00a1f4a..bbc4001 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -549,8 +549,15 @@ static void __init pandora_wl1251_init(void) pandora_wl1251_pdata.use_eeprom = true; ret = wl12xx_set_platform_data(&pandora_wl1251_pdata); - if (ret < 0) + /* bail out silently in case wl12xx isn't configured */ + if (ret == -ENOSYS) + goto fail_irq; + + /* bail out verbosely on any other error */ + if (ret) { + pr_err("error setting wl12xx data: %d\n", ret); goto fail_irq; + } return; diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index bfcd397..cc5cdd6 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -486,24 +486,42 @@ static void omap4_panda_init_rev(void) } } +static void __init omap4_panda_wlan_init(void) +{ + int ret; + + omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ); + + ret = wl12xx_set_platform_data(&omap_panda_wlan_data); + + /* bail out silently in case wl12xx isn't configured */ + if (ret == -ENOSYS) + return; + + /* bail out verbosely on any other error */ + if (ret) { + pr_err("error setting wl12xx data: %d\n", ret); + return; + } + + ret = platform_device_register(&omap_vwlan_device); + if (ret) + pr_err("error registering wl12xx's fixed regulator: %d\n", ret); +} + static void __init omap4_panda_init(void) { int package = OMAP_PACKAGE_CBS; - int ret; if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); - omap_panda_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ); - ret = wl12xx_set_platform_data(&omap_panda_wlan_data); - if (ret) - pr_err("error setting wl12xx data: %d\n", ret); + omap4_panda_wlan_init(); omap4_panda_init_rev(); omap4_panda_i2c_init(); platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); - platform_device_register(&omap_vwlan_device); omap_serial_init(); omap_sdrc_init(NULL, NULL); omap4_twl6030_hsmmc_init(mmc); diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index c166fe1..3506ed2 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -286,19 +286,33 @@ static void enable_board_wakeup_source(void) OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); } -void __init zoom_peripherals_init(void) +static void __init zoom_wlan_init(void) { int ret; omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO); + ret = wl12xx_set_platform_data(&omap_zoom_wlan_data); + /* bail out silently in case wl12xx isn't configured */ + if (ret == -ENOSYS) + return; - if (ret) + /* bail out verbosely on any other error */ + if (ret) { pr_err("error setting wl12xx data: %d\n", ret); + return; + } + ret = platform_device_register(&omap_vwlan_device); + if (ret) + pr_err("error registering wl12xx's fixed regulator: %d\n", ret); +} + +void __init zoom_peripherals_init(void) +{ omap_hsmmc_init(mmc); + zoom_wlan_init(); omap_i2c_init(); - platform_device_register(&omap_vwlan_device); usb_musb_init(NULL); enable_board_wakeup_source(); omap_serial_init();