From patchwork Fri Mar 20 03:34:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 46127 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D46A021515 for ; Fri, 20 Mar 2015 03:35:16 +0000 (UTC) Received: by labgq15 with SMTP id gq15sf15453835lab.0 for ; Thu, 19 Mar 2015 20:35:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=pOaLPeTaiRIxK0OBwZpZZY8eqYAKq1DSIm5fU/Fd4lg=; b=HE16kgRWlTJ6kbU3QvpVVpQHaa6IpZ+mA/YBBWWxstiR1m6xAkE9FAQL5e/HrpNduU HmpMCWvVTpLNdIRLhwvQDh6vVza76O98S7B7hOpvK3eOrmAJdqk0JGJnxAakzZLldbgj vSQJPXnMZQZQh40PlXQRwy517mj8qt7m3oT6wYZLNo+hABnwM6Zaq6V10dofE+kPEgTj 9YYk2kpA7csl+UVZDMo3r27dQw3W7bHPA9y8/dgo5TmThHaiV+ohfH6z+Z3+ZRoXvqmD T8BCSp1iVC7AmlJRoykToY3aMcH/f1e5F8hoKWCBAHq6INrwrbKrpb6DS/7oN1XM6SJL AfWA== X-Gm-Message-State: ALoCoQkYyS/A8sHut1kAf9vs0HcbmWlXMP3VoJ0dHNbE9YRQdnmA4cP4LBFfecQlQozNvcS8LuC0 X-Received: by 10.152.4.229 with SMTP id n5mr12618882lan.1.1426822515227; Thu, 19 Mar 2015 20:35:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.68 with SMTP id y4ls380271lay.12.gmail; Thu, 19 Mar 2015 20:35:15 -0700 (PDT) X-Received: by 10.152.197.34 with SMTP id ir2mr3542083lac.36.1426822515077; Thu, 19 Mar 2015 20:35:15 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id w7si2256721lbk.135.2015.03.19.20.35.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 20:35:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbrr9 with SMTP id rr9so2194974lbb.0 for ; Thu, 19 Mar 2015 20:35:14 -0700 (PDT) X-Received: by 10.152.197.34 with SMTP id ir2mr3542061lac.36.1426822514642; Thu, 19 Mar 2015 20:35:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp775886lbj; Thu, 19 Mar 2015 20:35:13 -0700 (PDT) X-Received: by 10.66.62.137 with SMTP id y9mr29626969par.87.1426822512827; Thu, 19 Mar 2015 20:35:12 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fc2si6749036pac.102.2015.03.19.20.35.12; Thu, 19 Mar 2015 20:35:12 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751218AbbCTDfB (ORCPT + 4 others); Thu, 19 Mar 2015 23:35:01 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34188 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750916AbbCTDfB (ORCPT ); Thu, 19 Mar 2015 23:35:01 -0400 Received: by pacwe9 with SMTP id we9so95337647pac.1 for ; Thu, 19 Mar 2015 20:35:00 -0700 (PDT) X-Received: by 10.67.8.73 with SMTP id di9mr180875664pad.107.1426822500664; Thu, 19 Mar 2015 20:35:00 -0700 (PDT) Received: from localhost ([122.167.64.77]) by mx.google.com with ESMTPSA id sg4sm5427036pac.11.2015.03.19.20.34.59 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Mar 2015 20:35:00 -0700 (PDT) From: Viresh Kumar To: Greg Kroah-Hartman Cc: linaro-kernel@lists.linaro.org, linux-usb@vger.kernel.org, Viresh Kumar Subject: [PATCH 2/2] USB: Move usb_disabled() towards top of the file Date: Fri, 20 Mar 2015 09:04:41 +0530 Message-Id: <01438c56e2b5c1a39557a9b5e138d4aa04973b11.1426822449.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d In-Reply-To: <2514348e278c1271496eda5311851fcd86c06df9.1426822449.git.viresh.kumar@linaro.org> References: <2514348e278c1271496eda5311851fcd86c06df9.1426822449.git.viresh.kumar@linaro.org> In-Reply-To: <2514348e278c1271496eda5311851fcd86c06df9.1426822449.git.viresh.kumar@linaro.org> References: <2514348e278c1271496eda5311851fcd86c06df9.1426822449.git.viresh.kumar@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Move usb_disabled() and module_param()/core_param() towards the top of the file, where 'nousb' is defined, as they are all related. Signed-off-by: Viresh Kumar --- drivers/usb/core/usb.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 006951728520..8d5b2f4113cd 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -49,6 +49,22 @@ const char *usbcore_name = "usbcore"; static bool nousb; /* Disable USB when built into kernel image */ +/* To disable USB, kernel command line is 'nousb' not 'usbcore.nousb' */ +#ifdef MODULE +module_param(nousb, bool, 0444); +#else +core_param(nousb, nousb, bool, 0444); +#endif + +/* + * for external read access to + */ +int usb_disabled(void) +{ + return nousb; +} +EXPORT_SYMBOL_GPL(usb_disabled); + #ifdef CONFIG_PM static int usb_autosuspend_delay = 2; /* Default delay value, * in seconds */ @@ -964,22 +980,6 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in, EXPORT_SYMBOL_GPL(usb_buffer_unmap_sg); #endif -/* To disable USB, kernel command line is 'nousb' not 'usbcore.nousb' */ -#ifdef MODULE -module_param(nousb, bool, 0444); -#else -core_param(nousb, nousb, bool, 0444); -#endif - -/* - * for external read access to - */ -int usb_disabled(void) -{ - return nousb; -} -EXPORT_SYMBOL_GPL(usb_disabled); - /* * Notifications of device and interface registration */