From patchwork Mon Jan 7 04:41:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13855 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9ED5C23E1F for ; Mon, 7 Jan 2013 04:50:06 +0000 (UTC) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by fiordland.canonical.com (Postfix) with ESMTP id 39122A18697 for ; Mon, 7 Jan 2013 04:50:06 +0000 (UTC) Received: by mail-vc0-f173.google.com with SMTP id f13so19139953vcb.32 for ; Sun, 06 Jan 2013 20:50:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=uG6mK8paIxZWJyCU48gHm8qTJGEi8FRDiXtP0pb65RU=; b=EPRzwimOGwCg9s7YU/oy1yuOH6uKmTCBdgnU86UsQxSplMpR3UVhBXHVJw+WPZ5W91 DxaHD7lQEMoHizIlIcdCKkq9QeiajoRGoc/pUZOE8tePbvc1+SSLrXUM4A6dnU8L/1SH AuHX4baSMvq8+394nM8EubVt2Jfpb5zC55grIbpJSIG9TvbMgDff6xidRO4t9sL5hej9 Ifh1rQugKlTIF2QKl6rFAY9Gh6eHyzck/oLkwalxgxlS7NgkSrP1b5TdiTRI+8orZ+Dn Piu5Z7UMuT14Ckd0GdlxmEb1sY5L6Bo9XMjuAjsX60/WeajxhQ9kraXfuZPxa4TYVNCU Uu0A== X-Received: by 10.58.196.196 with SMTP id io4mr84327226vec.22.1357534205662; Sun, 06 Jan 2013 20:50:05 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp45897veb; Sun, 6 Jan 2013 20:50:04 -0800 (PST) X-Received: by 10.68.233.197 with SMTP id ty5mr186404553pbc.9.1357534204564; Sun, 06 Jan 2013 20:50:04 -0800 (PST) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id y1si58369720pav.103.2013.01.06.20.50.04 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Jan 2013 20:50:04 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pa0-f52.google.com with SMTP id fb1so10502513pad.39 for ; Sun, 06 Jan 2013 20:50:04 -0800 (PST) X-Received: by 10.68.220.198 with SMTP id py6mr184394597pbc.119.1357534204059; Sun, 06 Jan 2013 20:50:04 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id v2sm37970057paz.36.2013.01.06.20.50.01 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Jan 2013 20:50:03 -0800 (PST) From: Sachin Kamat To: linux-usb@vger.kernel.org Cc: stern@rowland.harvard.edu, gregkh@linuxfoundation.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] USB: OHCI: Fix definition overriding while registering Exynos OHCI driver Date: Mon, 7 Jan 2013 10:11:55 +0530 Message-Id: <1357533715-22911-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQn97Y5OUWtrkrw+5Y9d8UbYVOe64FmwMNIL7BXSTf8Sc2RpPWDa5khttaxpnNKzBkxYMQIu Exynos OHCI driver does not get registered if generic OHCI driver is also selected as the macro PLATFORM_DRIVER gets re-defined to 'ohci_platform_driver' instead of 'exynos_ohci_driver'. Hence define it separately. Also, silences the following compilation warnings: drivers/usb/host/ohci-hcd.c:1191:0: warning: "PLATFORM_DRIVER" redefined [enabled by default] drivers/usb/host/ohci-hcd.c:1110:0: note: this is the location of the previous definition drivers/usb/host/ohci-exynos.c:276:31: warning: ‘exynos_ohci_driver’ defined but not used [-Wunused-variable] Signed-off-by: Sachin Kamat --- drivers/usb/host/ohci-hcd.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 180a2b0..22b6ccd 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1107,7 +1107,7 @@ MODULE_LICENSE ("GPL"); #ifdef CONFIG_USB_OHCI_EXYNOS #include "ohci-exynos.c" -#define PLATFORM_DRIVER exynos_ohci_driver +#define EXYNOS_PLATFORM_DRIVER exynos_ohci_driver #endif #ifdef CONFIG_USB_OHCI_HCD_OMAP1 @@ -1193,6 +1193,7 @@ MODULE_LICENSE ("GPL"); #if !defined(PCI_DRIVER) && \ !defined(PLATFORM_DRIVER) && \ + !defined(EXYNOS_PLATFORM_DRIVER) && \ !defined(OMAP1_PLATFORM_DRIVER) && \ !defined(OMAP3_PLATFORM_DRIVER) && \ !defined(OF_PLATFORM_DRIVER) && \ @@ -1235,6 +1236,12 @@ static int __init ohci_hcd_mod_init(void) goto error_platform; #endif +#ifdef EXYNOS_PLATFORM_DRIVER + retval = platform_driver_register(&EXYNOS_PLATFORM_DRIVER); + if (retval < 0) + goto error_exynos_platform; +#endif + #ifdef OMAP1_PLATFORM_DRIVER retval = platform_driver_register(&OMAP1_PLATFORM_DRIVER); if (retval < 0) @@ -1304,6 +1311,10 @@ static int __init ohci_hcd_mod_init(void) platform_driver_unregister(&PLATFORM_DRIVER); error_platform: #endif +#ifdef EXYNOS_PLATFORM_DRIVER + platform_driver_unregister(&EXYNOS_PLATFORM_DRIVER); + error_exynos_platform: +#endif #ifdef OMAP1_PLATFORM_DRIVER platform_driver_unregister(&OMAP1_PLATFORM_DRIVER); error_omap1_platform: