From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8EB1E95A86 for ; Sun, 8 Oct 2023 00:54:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234220AbjJHAyr (ORCPT ); Sat, 7 Oct 2023 20:54:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344290AbjJHAym (ORCPT ); Sat, 7 Oct 2023 20:54:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C783710C0; Sat, 7 Oct 2023 17:50:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B000C43391; Sun, 8 Oct 2023 00:50:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696726217; bh=b7SnnV4jMEcjmKzD7qD5D/YT1PbL3lTXsAzSPOL0H/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TksqsFAjbdpa4YVIMLxz5ijrXeHH2iQKicO8+y4T2DXlP9yIOdjHc6f9CE6TUyIZj mS/cZeB3HrjfE9miUn4A7w73KPb+OpGwi+5i6XdtJb/wR2lVVwkSRUZZA9qwAzD3Q8 fcIHTiKf8Tm0CMKt+ZAPotN8CNqjqtD4kpNveRdSFy8+peUs/nHoNzih95v/DtYkpO VPjnkDic7W48itAg+Kt0xpMeyR3HK72P8Q7iyCyMyq4kAD5vA0DCi2gxH/rs/IpMJw XxSSauYHNZbEgAClwHwp959sY2OFmcEL83XemN6HHV9WyvxMR6uXFqYoZAOddQD88I 2qVc9zcTfFZBw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Heiner Kallweit , Peter Rosin , Wolfram Sang , Sasha Levin , linux-i2c@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 4/8] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter Date: Sat, 7 Oct 2023 20:50:05 -0400 Message-Id: <20231008005009.3768314-4-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231008005009.3768314-1-sashal@kernel.org> References: <20231008005009.3768314-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.197 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Heiner Kallweit [ Upstream commit b13e59e74ff71a1004e0508107e91e9a84fd7388 ] I2C_CLASS_DEPRECATED is a flag and not an actual class. There's nothing speaking against both, parent and child, having I2C_CLASS_DEPRECATED set. Therefore exclude it from the check. Signed-off-by: Heiner Kallweit Acked-by: Peter Rosin Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/i2c-mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 774507b54b57b..c90cec8d9656d 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -340,7 +340,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, priv->adap.lock_ops = &i2c_parent_lock_ops; /* Sanity check on class */ - if (i2c_mux_parent_classes(parent) & class) + if (i2c_mux_parent_classes(parent) & class & ~I2C_CLASS_DEPRECATED) dev_err(&parent->dev, "Segment %d behind mux can't share classes with ancestors\n", chan_id); -- 2.40.1