Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1190344imi; Fri, 22 Jul 2022 20:37:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sOf6+Fq2itY/1UFFyi5bgXNHdp8arnFhX/i2JTlz/mr3u6/utI3qwYLpOakkn8f+sfKVAs X-Received: by 2002:a63:1e14:0:b0:41a:77ee:acb3 with SMTP id e20-20020a631e14000000b0041a77eeacb3mr2436383pge.84.1658547479046; Fri, 22 Jul 2022 20:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658547479; cv=none; d=google.com; s=arc-20160816; b=CbVpULtVo5vB2uNhbbGwQZY7fTi+mN21mZ8aLrEV7nALBJFvJWc4osBErL3Kr8X7bq dyGh6KMo+Q/bUqqEwtSJz3pppnEhP0zYzk4vfbWc5XCS94W9MvOmHKEAnCsPOtsqZiWP 3fF3RKNmBUmZbtW77PtwDvxNiALotabE72tIMICsTvR5+t3Qq7DsmUdz0O03h9I2v3NH na3TXx64U7lZRly69rqP95TpJJl3gUhc+sZFQU4P/ALADfB166Oi/0JYpJgyGuUcqHOz 9KUmQLwjS/vs4Q8Mn4BUZ2GTbF4TdkLljigTFHBPWMRuKhKfSBpqfZNe06HqDZakHGUE reZA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=JiQL3v43ih0CKjiymG4BT5ELIGSeW1i9a3/8dRvOgxk=; b=H2EDaM9f3hVUJhQuEL2zmOgiIpDFt90cCHiEruiSXhULeAiyPue5tLED3/78y2SbvD tB6/jbSR6SeX0m0Ipe+Qggn5VbVK/kjaGno2YhvdQP0Vn7SbCAU+snnpJAuW1AQFyk0K lLjEpzbRyM3qjQEkGk2OO08At5ewme2S2xj17wGbrlf9OYdcRNRunwMCPKeQ9TDALCt3 gs/x/H+7IP2GE2NlA8XJs4Y8nAROoQDa8ez8Cjw175vR6NyaAe26JojKGWd2JgCtZflo HICvsKrHe9igXgX3kL9LedVU7S5T1TVDiZwvnSH7IaHaAFlddPGf4iEarDBNdUKBa43G 1VWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b="O/nfmU5A"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m184-20020a6326c1000000b00419fc0f56a3si8388229pgm.89.2022.07.22.20.37.20; Fri, 22 Jul 2022 20:37:59 -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; dkim=pass header.i=@163.com header.s=s110527 header.b="O/nfmU5A"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234969AbiGWDYl (ORCPT + 99 others); Fri, 22 Jul 2022 23:24:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiGWDYk (ORCPT ); Fri, 22 Jul 2022 23:24:40 -0400 Received: from mail-m975.mail.163.com (mail-m975.mail.163.com [123.126.97.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B3C9670981; Fri, 22 Jul 2022 20:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=JiQL3 v43ih0CKjiymG4BT5ELIGSeW1i9a3/8dRvOgxk=; b=O/nfmU5AT6QRqxMh3N2/1 jOKCzS/GFksAtNA9TjaBkL9qcWqBfU8K6MSMNQlfUPOvgA7OCosqruRwXJRjBsLi JLK4Xk7VijpoZAOf5tPEA3zXzi2oXUoJ0kIkfIljwtqFbv88tmKzCDLuwxE923Mx ZFM2UUA4xqZQfT5f+FFEIQ= Received: from localhost.localdomain (unknown [123.58.221.99]) by smtp5 (Coremail) with SMTP id HdxpCgBX2jeyadtiKGBKPw--.22880S2; Sat, 23 Jul 2022 11:23:32 +0800 (CST) From: williamsukatube@163.com To: agross@kernel.org, bjorn.andersson@linaro.org, srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: konrad.dybcio@somainline.org, William Dean , Hacash Robot Subject: [PATCH] slimbus: qcom-ngd-ctrl: Add check for platform_driver_register Date: Sat, 23 Jul 2022 11:23:28 +0800 Message-Id: <20220723032328.2951275-1-williamsukatube@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: HdxpCgBX2jeyadtiKGBKPw--.22880S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jr4DCF47Gry3ZFyDur15urg_yoWkGFgEk3 48uF9Fqrs5CFnrAFnFqFnrZ34IvFn5ursa9r10qFy3t3y8XF4DWrn0vFs8CFWUCrWrt34U J3Z0krZ7CrW3GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU51wZ7UUUUU== X-Originating-IP: [123.58.221.99] X-CM-SenderInfo: xzlozx5dpv3yxdwxuvi6rwjhhfrp/1tbiURRHg2DEOrvjQwAAsE X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 From: William Dean As platform_driver_register() could fail, it should be better to deal with the return value in order to maintain the code consisitency. Fixes: 1830dad34c070 ("slimbus: ngd: register ngd driver only once.") Reported-by: Hacash Robot Signed-off-by: William Dean --- drivers/slimbus/qcom-ngd-ctrl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 0aa8408464ad..a31ec00a37ac 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1585,7 +1585,12 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) return PTR_ERR(pds); } - platform_driver_register(&qcom_slim_ngd_driver); + ret = platform_driver_register(&qcom_slim_ngd_driver); + if (ret) { + dev_err(dev, "platform driver register failed: %d\n", ret); + return ret; + } + return of_qcom_slim_ngd_register(dev, ctrl); } -- 2.25.1