Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6629179ioo; Thu, 2 Jun 2022 10:17:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf5q69hhqHK/Nk2FeVzPG+sow7b/chD6wQNhG/iqmq5RF59v4pvmnOGRh1/ujMmJ9BspIY X-Received: by 2002:a17:90b:4d8f:b0:1e6:f83a:6982 with SMTP id oj15-20020a17090b4d8f00b001e6f83a6982mr825378pjb.186.1654190279410; Thu, 02 Jun 2022 10:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654190279; cv=none; d=google.com; s=arc-20160816; b=Hihs8UexYXNKq1gKRxJuitd1NUCjMeMCHn2UPN15TAW0yWoKAy7JNQ5UQHbVXPrEu9 JfRFkv/oF0P25Or7r9+T533IGW7wP6uaZZtT9izqt9AII906yG9Ra7jvmTV0WpxH4Exk risiSFyL+52rMw73GNNpE684Yw3cjhysNz040Y66bkUEDvxMmbIq/1snM6xC4d4G+Hmu aTfX5b9lIZh+iUrNZk3Hjzwneyxk7BKeHeLvnyYRhfqYXywIZDyZMl512CX+LcJ6tySZ ft10i0areIGgx+/pDVJUycVaGqgDC3RZLCSFENKxEKOYKcWnMbZM1edQsgrjkBNmnk8E BU4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=tL5eeti2slq6dXtXGb6rpvbbXeaYDVb1nysipmR4tCM=; b=JeQmts4W3A+BPt6UxsHWVS3ZtRkwmLLhrmFB2X/HbkXuOUMhK58Zu9CYLs70ycuiSg SXNP7h4+NtWSmitSxQWJe2mCxQTnO6VQs5t3Tm4uvyiOcI+Dr76filHGmxAqIja4H1QN ri2ptER3FJwSDtWM3lGTTyGSZNlSK5KL3RDRV244nzgConnwl5Nwq7mNbT4BqPtwdSHf /MRg/gn2eBV1h9hM+J08YrItJLTN/hq8pnpXt3JNFvD2omgo2320dpAdHPJ7Wbcck6Ud 9ND/L7jqJmPGu7/2R1bFiYXnv4Igpb4cf5l0aL8ZCqlKzKLP2U8cj4R7eMx+fAaGuk0J rXVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l191-20020a6391c8000000b003c6b63ed4adsi6627629pge.331.2022.06.02.10.17.29; Thu, 02 Jun 2022 10:17:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234742AbiFBPkh convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 Jun 2022 11:40:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232621AbiFBPkh (ORCPT ); Thu, 2 Jun 2022 11:40:37 -0400 Received: from mail.holtmann.org (coyote.holtmann.net [212.227.132.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C0C19279E75; Thu, 2 Jun 2022 08:40:35 -0700 (PDT) Received: from smtpclient.apple (p4ff9fc30.dip0.t-ipconnect.de [79.249.252.48]) by mail.holtmann.org (Postfix) with ESMTPSA id 0D110CED19; Thu, 2 Jun 2022 17:40:35 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: [PATCH] iBluetooth: hci_intel: Add check for platform_driver_register From: Marcel Holtmann In-Reply-To: <20220531033228.1939386-1-jiasheng@iscas.ac.cn> Date: Thu, 2 Jun 2022 17:40:34 +0200 Cc: Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <1230E2E8-B3F7-470F-B03F-2060173B5821@holtmann.org> References: <20220531033228.1939386-1-jiasheng@iscas.ac.cn> To: Jiasheng Jiang X-Mailer: Apple Mail (2.3696.100.31) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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-bluetooth@vger.kernel.org Hi Jiasheng, > As platform_driver_register() could fail, it should be better > to deal with the return value in order to maintain the code > consisitency. > > Fixes: 1ab1f239bf17 ("Bluetooth: hci_intel: Add support for platform driver") > Signed-off-by: Jiasheng Jiang > --- > drivers/bluetooth/hci_intel.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c > index 7249b91d9b91..d4801b26cc8e 100644 > --- a/drivers/bluetooth/hci_intel.c > +++ b/drivers/bluetooth/hci_intel.c > @@ -1217,7 +1217,11 @@ static struct platform_driver intel_driver = { > > int __init intel_init(void) > { > - platform_driver_register(&intel_driver); > + int ret; > + > + ret = platform_driver_register(&intel_driver); > + if (ret) > + return ret; most of the driver uses int err. So please do that as well. Regards Marcel