Received: by 10.213.65.68 with SMTP id h4csp458491imn; Tue, 13 Mar 2018 09:42:10 -0700 (PDT) X-Google-Smtp-Source: AG47ELtjcAivc/fWo4VWr8wZ1sLCvXcrNc4shCZECpHv7m57kj7fhLCZXdMLdSjl8rnLg/niJae7 X-Received: by 2002:a17:902:22a:: with SMTP id 39-v6mr1163157plc.128.1520959330517; Tue, 13 Mar 2018 09:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520959330; cv=none; d=google.com; s=arc-20160816; b=XZD83mDrBVlhhIsKvVO75ZBewGCWqbwuu1vhEVp9hf4X5h8cvu7Pn2JgE7G9PL6DiO Px1VjEPgCK4EPYU6a1rksuXd4jsIyzpnTwsPv5w3l2cFXOv7OnFMK0/9YYZFG029Bp1G u4KcUPGv2MmuOrBV8DRU5woPKPtl34bpbqk5/algTkQBANPevcRBnLwD9Q36/f8c8srJ RUq1BkkdaNLfWGaAdBjFqazkxKH3B6tCkCz8d3X/fLmNyYI1yDYkJUs9Xifc39zoos/G kfaVfzXPZ/EBcNPy4CD9uwdLrok06TbWpXxpISFEXn2bWdoZfIGMFhngOY447sIR3v7q 3OWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=p5VPrGZ0wAoGQR375atruq8NpAESWkEc9WKli2EUG5w=; b=wHJtkrAmbbcqflTaVHryYkM7UzlwhR4ra/QDHovR8jJCv2MObYSXs0r+tklhkgKUpf +aia9LDwEm5Ja6d4imupMKGj0FtA29PG11bVp7jZnQtV2WUA8svvcqOGWLNqzK6XO7s1 aBDj4KpQInBlj1I3Btdgw96DvAEbnpRs5aK7iJxdQdwzLp6NOnwK3SJvGQr/eSCRoMUq UmUyol6DLVpqEO1+aHidCtXY8826BWp+XPItmoXyIBosyDCMXv1xbzF0Wk2pQ8u7veya uYBpSKYzBnPEQj1VcMCgK/ZmMUmDrK5Qc2woRvXDF5HvPSPtgHEuTMr8Op7OJo3ocBeX 740w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n25si308758pgc.87.2018.03.13.09.41.55; Tue, 13 Mar 2018 09:42:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753136AbeCMQka (ORCPT + 99 others); Tue, 13 Mar 2018 12:40:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:43865 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbeCMQk2 (ORCPT ); Tue, 13 Mar 2018 12:40:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 94B6CAF97; Tue, 13 Mar 2018 16:40:26 +0000 (UTC) Date: Tue, 13 Mar 2018 16:40:26 +0000 From: "Luis R. Rodriguez" To: Kalle Valo Cc: "Luis R. Rodriguez" , Andres Rodriguez , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , linux-wireless , Arend Van Spriel Subject: Re: [PATCH] firmware: add a function to load optional firmware v2 Message-ID: <20180313164026.GG4449@wotan.suse.de> References: <20180309221243.15489-2-andresx7@gmail.com> <20180309230925.3573-1-andresx7@gmail.com> <87a7vcazf1.fsf@kamboji.qca.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a7vcazf1.fsf@kamboji.qca.qualcomm.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 13, 2018 at 03:16:34PM +0200, Kalle Valo wrote: > "Luis R. Rodriguez" writes: > > >> +/** > >> + * request_firmware_optional: - request for an optional fw module > >> + * @firmware_p: pointer to firmware image > >> + * @name: name of firmware file > >> + * @device: device for which firmware is being loaded > >> + * > >> + * This function is similar in behaviour to request_firmware(), except > >> + * it doesn't produce warning messages when the file is not found. > >> + **/ > >> +int > >> +request_firmware_optional(const struct firmware **firmware_p, const char *name, > >> + struct device *device) > >> +{ > >> + int ret; > >> + > >> + /* Need to pin this module until return */ > >> + __module_get(THIS_MODULE); > >> + ret = _request_firmware(firmware_p, name, device, NULL, 0, > >> + FW_OPT_UEVENT | FW_OPT_NO_WARN ); > >> + module_put(THIS_MODULE); > >> + return ret; > >> +} > >> +EXPORT_SYMBOL(request_firmware_optional); > > > > New exported symbols for the firmware API should be EXPORT_SYMBOL_GPL(). > > To me the word optional feels weird to me. For example, in ath10k I > suspect we would be only calling request_firmware_optional() with all > firmware and not request_firmware() at all. > > How about request_firmware_nowarn()? That would even match the > documentation above. _nowarn() works with me. Do you at least want the return value to give an error value if no file was found? This way the driver can decide when to issue an error if it wants to. Luis