Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3411798rwa; Tue, 23 Aug 2022 04:27:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Mc5mBEDHpTDG553K6qt9l3wnOmlHZ5AoagBMe/iCLI6LEaKCGxZ5H1uKoMxHRxXc+9JYv X-Received: by 2002:a65:4381:0:b0:429:8c34:535e with SMTP id m1-20020a654381000000b004298c34535emr20288025pgp.91.1661254075589; Tue, 23 Aug 2022 04:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254075; cv=none; d=google.com; s=arc-20160816; b=teyykxJX2PQHgNbustJ2HtTSpsA5zOb07YU+CFx17ESV6b/M+CGPdeYkTvlwqoLCzE JACa8xE5qeVL4tDPSw4KoTzEmmWMFD5DhvHKrv1rTylHPCVuJiq/FtaGVT7VKe+Bk9ww inSoDuyxLkRNYeNCV9tmDKOpStUxvEYy56WCScrcypTFBCU7YozfDarMLtJNunCpaiBv Y86HwOF73GI7v2D/fOhC1YWhcDSkootM1qZAfen7OLHbvMQ6rem+bKQbT4jzzRelQblt ViGsTlFHXlTwM3NXxaMQWXyiwUWKFO/+MuhRRswqs1tkuTonn3B120Sl2LP0YX40DBEb mpqA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dkZQXoDqDzQQJNIubknB0pY4yaHAEFcTvjJWQZGPvzg=; b=EO4LmaE0vbjG8toRc9fKhc5EqvOaYYQ9s6+5sebTVScWm7z2eqcYjghv5+j8X2wDir AaU0OOljcdxjUpPRpVHcTeUGFBfJUntF+0LpLbN764hNtsDHSO4iS7vTBSH7BZab2bkq C1OQOmHyWO77iIE3nJYtFISmPEAsIQNF05UHV54ecJKWQat037SEVjCd/e381UvMpYQU mQBUcnlHUB13d4AEqZQovLs4kowCiWlPurBcKrKGZyNTgTZeom73oToK+AZrja9rhGjL tad7rrZ/qEGOxg3UsTA/IRnibvJzPHGEzVRp4/TLyFXh/DdVXCMmo/oV5y/VM4YTUaDP +7VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i7uOU+xh; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a637146000000b0041bc27b1bd5si15376602pgn.462.2022.08.23.04.27.44; Tue, 23 Aug 2022 04:27:55 -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=@linuxfoundation.org header.s=korg header.b=i7uOU+xh; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243596AbiHWJwv (ORCPT + 99 others); Tue, 23 Aug 2022 05:52:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351841AbiHWJu5 (ORCPT ); Tue, 23 Aug 2022 05:50:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04B8E61728; Tue, 23 Aug 2022 01:45:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7D07EB81C6C; Tue, 23 Aug 2022 08:45:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC41DC433D6; Tue, 23 Aug 2022 08:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244320; bh=EjuNj/W6yvY3QRPw/sASGRs/Haf5FAtW1SwjLFbn8ho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i7uOU+xhTlDzZmi6sIsZ1a1qhCRfratKmUHXgCSrbgnOn7ZsWAn/MU0dKFmT0uZWb pR6p0DnTBmwfqqV0UXOEPZP4xpO0Hpcea5LuLuNeq8yk/EzMabo9tGqGPeOC4NCy7U 7Yzwd5zDmRo0zWzD1BI2iRcy1istRL+p4eXunFmM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Mark Brown , Sasha Levin Subject: [PATCH 4.14 119/229] ASoC: codecs: da7210: add check for i2c_add_driver Date: Tue, 23 Aug 2022 10:24:40 +0200 Message-Id: <20220823080057.953286886@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Jiasheng Jiang [ Upstream commit 82fa8f581a954ddeec1602bed9f8b4a09d100e6e ] As i2c_add_driver could return error if fails, it should be better to check the return value. However, if the CONFIG_I2C and CONFIG_SPI_MASTER are both true, the return value of i2c_add_driver will be covered by spi_register_driver. Therefore, it is necessary to add check and return error if fails. Fixes: aa0e25caafb7 ("ASoC: da7210: Add support for spi regmap") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220531094712.2376759-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/da7210.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index 1af443ccbc51..ba38ea99b1da 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -1351,6 +1351,8 @@ static int __init da7210_modinit(void) int ret = 0; #if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&da7210_i2c_driver); + if (ret) + return ret; #endif #if defined(CONFIG_SPI_MASTER) ret = spi_register_driver(&da7210_spi_driver); -- 2.35.1