Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758995AbcJTJxj (ORCPT ); Thu, 20 Oct 2016 05:53:39 -0400 Received: from atlantic540.startdedicated.de ([188.138.9.77]:46980 "EHLO atlantic540.startdedicated.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933343AbcJTJw1 (ORCPT ); Thu, 20 Oct 2016 05:52:27 -0400 From: Daniel Wagner To: linux-kernel@vger.kernel.org Cc: Ming Lei , "Luis R . Rodriguez" , Greg Kroah-Hartman , "Srivatsa S . Bhat" , "Rafael J . Wysocki" , Daniel Vetter , Takashi Iwai , Bjorn Andersson , Arend van Spriel , Daniel Wagner Subject: [PATCH v6 3/6] firmware: rename fw_load_from_user_helper() and _request_firmware_load() Date: Thu, 20 Oct 2016 11:52:09 +0200 Message-Id: <1476957132-27818-4-git-send-email-wagi@monom.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476957132-27818-1-git-send-email-wagi@monom.org> References: <1476957132-27818-1-git-send-email-wagi@monom.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2836 Lines: 81 From: Daniel Wagner fw_load_from_user_helper() and _request_firmware_load() are used when CONFIG_FW_LOADER_USER_HELPER is enabled. In order to clearly mark which part of the code is depending on UMH we stream line these functions to match with the rest of the code. Suggested by Luis. Signed-off-by: Daniel Wagner Acked-by: Luis R. Rodriguez Cc: Ming Lei Cc: Greg Kroah-Hartman --- drivers/base/firmware_class.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index b7a9fa1c5197..a6916a7aaeb2 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -986,9 +986,8 @@ fw_create_instance(struct firmware *firmware, const char *fw_name, return fw_priv; } -/* load a firmware via user helper */ -static int _request_firmware_load(struct firmware_priv *fw_priv, - unsigned int opt_flags, long timeout) +static int _request_firmware_umh(struct firmware_priv *fw_priv, + unsigned int opt_flags, long timeout) { int retval = 0; struct device *f_dev = &fw_priv->dev; @@ -1039,9 +1038,9 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, return retval; } -static int fw_load_from_user_helper(struct firmware *firmware, - const char *name, struct device *device, - unsigned int opt_flags, long timeout) +static int fw_get_umh_firmware(struct firmware *firmware, const char *name, + struct device *device, unsigned int opt_flags, + long timeout) { struct firmware_priv *fw_priv; int ret; @@ -1070,7 +1069,7 @@ static int fw_load_from_user_helper(struct firmware *firmware, } fw_priv->buf = firmware->priv; - ret = _request_firmware_load(fw_priv, opt_flags, timeout); + ret = _request_firmware_umh(fw_priv, opt_flags, timeout); release_lock: usermodehelper_read_unlock(); @@ -1096,9 +1095,9 @@ static void kill_requests_without_uevent(void) #else /* CONFIG_FW_LOADER_USER_HELPER */ static inline int -fw_load_from_user_helper(struct firmware *firmware, const char *name, - struct device *device, unsigned int opt_flags, - long timeout) +fw_get_umh_firmware(struct firmware *firmware, const char *name, + struct device *device, unsigned int opt_flags, + long timeout) { return -ENOENT; } @@ -1242,8 +1241,8 @@ _request_firmware(const struct firmware **firmware_p, const char *name, name, ret); if (opt_flags & FW_OPT_USERHELPER) { dev_warn(device, "Falling back to user helper\n"); - ret = fw_load_from_user_helper(fw, name, device, - opt_flags, timeout); + ret = fw_get_umh_firmware(fw, name, device, + opt_flags, timeout); } } -- 2.7.4