Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1916011rwd; Fri, 9 Jun 2023 04:14:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6udinPMV1DJ8FlZ9uUxWQC1c/JUg4JUYgyfQM1LCNOAZHGel8H+y4RZAPiyAPT+OuV5DSk X-Received: by 2002:a05:6a20:1584:b0:114:ec7e:a60a with SMTP id h4-20020a056a20158400b00114ec7ea60amr1207917pzj.38.1686309276026; Fri, 09 Jun 2023 04:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686309276; cv=none; d=google.com; s=arc-20160816; b=KmcJ49yG72lsoooWC3RmGe8ICROUuozMOqUobaxiqfUh/CbiFDy6jCoEgzGhy8+lNr cNdjHK5lqZbtM0FRWmmCwTgJ5KKBBejnKHc/K7w8JfYz6ArUTpDB542GI662983tl2Ur vTghZk+LFpr5F9xizZZ19LZGEMK6JwXJYl+88x0p/ejeNgcYMwplmg1Zc8wmRgThkRL7 MX+JumXVFgHRxQWMmQ3p9iCtywVEJ9hRsq1wxVaIQH9mQh+3Yx5dDNG3l+gxMcUV5Yy2 UWRoJ4jJlaykQcESwOKqShr8nCQhgulUjflzu/omult+/XNinYPtJhx4YJZUEQU1DGVm +cFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=m5Ch1BPZtt5wdLEqCA/HKtRjaFvCNVh+y/Q1ELA550E=; b=0OUlu/bfp/wacV0Iz0ZemWgXlI1sYPwZr+6AzU0QhkpAePDUI4MANM+CQvJ68ngKSg QILcdo16dX0MsvTab7Vee4+Isf/0o18/8SWZl0KsqjozMYJxiDeIspVNbhWKb2xoF8ZL wPLnNY0nAlr76hWTSgHJAJEDnWfqmlT+CE274chvNb43Zu7JConPKEQYbX9tESqSP2z6 S3D23g5V0ZY1rTdafxkTmNiton8OxHUJG1z7yRlgd6zFaOGUYInFYgoyp26SBlDRv1xB qnb8G7BnVkISSFo9im+HblrW8LBeItdDeYIBZCWjTso//sJd4CXJTZYtw7/ciOuyqMsb a8hQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s26-20020aa78bda000000b0063354a65327si2254023pfd.395.2023.06.09.04.14.17; Fri, 09 Jun 2023 04:14:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238011AbjFILHJ convert rfc822-to-8bit (ORCPT + 99 others); Fri, 9 Jun 2023 07:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230460AbjFILHB (ORCPT ); Fri, 9 Jun 2023 07:07:01 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F98F1FDC; Fri, 9 Jun 2023 04:07:00 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Qcys02y3Lz6J7wD; Fri, 9 Jun 2023 19:04:36 +0800 (CST) Received: from localhost (10.126.170.42) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 9 Jun 2023 12:06:57 +0100 Date: Fri, 9 Jun 2023 12:06:56 +0100 From: Jonathan Cameron To: "Verma, Vishal L" CC: "Jiang, Dave" , "Schofield, Alison" , "linux-cxl@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Williams, Dan J" , "Weiny, Ira" , "bwidawsk@kernel.org" , "Weight, Russell H" , "dave@stgolabs.net" Subject: Re: [PATCH v2 1/4] cxl: add a firmware update mechanism using the sysfs firmware loader Message-ID: <20230609120656.0000554b@Huawei.com> In-Reply-To: <6666972e336a6749f24ce3aab7dddad63a796974.camel@intel.com> References: <20230602-vv-fw_update-v2-0-e9e5cd5adb44@intel.com> <20230602-vv-fw_update-v2-1-e9e5cd5adb44@intel.com> <20230608154905.00007551@Huawei.com> <6666972e336a6749f24ce3aab7dddad63a796974.camel@intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.126.170.42] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > > +???????struct fw_upload *fwl; > > > +???????int rc; > > > + > > > +???????if (!test_bit(CXL_MEM_COMMAND_ID_GET_FW_INFO, cxlds->enabled_cmds)) > > > +???????????????return 0; > > > + > > > +???????fwl = firmware_upload_register(THIS_MODULE, &cxlmd->dev, > > > +????????????????????????????????????? dev_name(&cxlmd->dev), > > > +????????????????????????????????????? &cxl_memdev_fw_ops, cxlds); > > > +???????if (IS_ERR(fwl)) { > > > +???????????????dev_err(&cxlmd->dev, "Failed to register firmware loader\n"); > > > +???????????????return PTR_ERR(fwl); > > > > It's called from probe only so could use dev_err_probe() for slight > > simplification. > > From what I can tell, this ends up looking like: > > fwl = firmware_upload_register(THIS_MODULE, dev, > dev_name(dev), > &cxl_memdev_fw_ops, cxlds); > rc = dev_err_probe(dev, PTR_ERR(fwl), > "Failed to register firmware loader\n"); > if (rc) > return rc; > > Is that what you meant? Happy to make the change if so. fwl = firmware_upload_register(THIS_MODULE, dev, dev_name(dev), &cxl_memdev_fw_ops, cxlds); if (IS_ERR(fwl) return dev_err_probe(dev, PTR_ERR(fwl), "Failed to register firmware loader\n");