From nobody Thu Apr 2 10:44:11 2026 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7E7837DEBA for ; Sun, 29 Mar 2026 16:32:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774801963; cv=none; b=kxan8LIULTAelplQnFnLxmp6G9L144iae1LuehHTQ8MqnTGXzJD+FO+NXDyn5ZOdKdLW3dE2jUkWEzXGTn1Yer+jZ0NnqE7iBT6RXP4EQjdIyffngc86qFPzwnLAfKhZjRkLvwEZkmvWd0vevzzqgfiV7ZhdEdKzvQ58qLkPiFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774801963; c=relaxed/simple; bh=OsH+XaU/LdG1MgJog3EKxeHIfWRW4v8IQt4TToAq+Zw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KkJV/RbdidRhj4ZCl5J98xxVW8BtMrUE56k83Gr4tn3TvEQHNSfB98M9Xh16RGpc9Uoy93kCo7HR0p7ljrqewoEKXBwGmmJ45Cpn+U04+pL+IhPiO+yNQnPfMSL1o5MzfakgN+64ASuXxR81THFuiIBzD11qGiUEy3FTLl+Ca2I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=AqG0hTn6; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="AqG0hTn6" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1774801959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+uWaFI1B5um5iR8rXjg5h5IEWXydoejLkEYSf/v/l50=; b=AqG0hTn6ZiJ9nsJnODLi1h38MUuY0POMQJMSWiQV+44K71ciFwxsfMHOAA9AZkFbOsvcDZ gXHzpL5FeJGrt9hBI53X4ufzZuDNSU8JSywt0t4tUZkdb2eD/cKBNpwm4uQ+CcjlIiDLKm uZKd6Ny33A50wSJUXClO2idBuGSSsVY= From: Thorsten Blum To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Chris Morgan , Kuninori Morimoto , Dan Carpenter , Thorsten Blum , Weidong Wang , Marco Crivellari , Luca Weiss , Alexandre Ferrieux , Bharadwaj Raju , Charles Keepax , Srinivas Kandagatla , Chen Ni , Krzysztof Kozlowski Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: codecs: inline i2c_check_functionality checks Date: Sun, 29 Mar 2026 18:31:46 +0200 Message-ID: <20260329163152.366356-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3489; i=thorsten.blum@linux.dev; h=from:subject; bh=OsH+XaU/LdG1MgJog3EKxeHIfWRW4v8IQt4TToAq+Zw=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDJkng39IHL9h0l938trh5au01yhoxGZ++fLwVuUjR8Esc XuOqgelHaUsDGJcDLJiiiwPZv2Y4VtaU7nJJGInzBxWJpAhDFycAjCR6ARGhjV71622Wple3HPs 1sTko8dlrgTpXf4xbeOkg0GuOdnsr9YxMuzQzV767mnM7tVHNhqVWqk+frmlaY+U+6P7x8uMN3L xRTEDAA== X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Inline i2c_check_functionality() checks, since the function returns a boolean status rather than an error code. Signed-off-by: Thorsten Blum --- sound/soc/codecs/aw87390.c | 3 +-- sound/soc/codecs/aw88081.c | 3 +-- sound/soc/codecs/aw88261.c | 3 +-- sound/soc/codecs/max98390.c | 6 ++---- sound/soc/codecs/max98520.c | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/aw87390.c b/sound/soc/codecs/aw87390.c index 613daccca3af..37ca42a25889 100644 --- a/sound/soc/codecs/aw87390.c +++ b/sound/soc/codecs/aw87390.c @@ -544,8 +544,7 @@ static int aw87390_i2c_probe(struct i2c_client *i2c) const struct snd_soc_component_driver *priv; int ret; =20 - ret =3D i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C); - if (!ret) + if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed\n"); =20 aw87390 =3D devm_kzalloc(&i2c->dev, sizeof(*aw87390), GFP_KERNEL); diff --git a/sound/soc/codecs/aw88081.c b/sound/soc/codecs/aw88081.c index fbd1fd12381a..8c5bb3ea0227 100644 --- a/sound/soc/codecs/aw88081.c +++ b/sound/soc/codecs/aw88081.c @@ -1253,8 +1253,7 @@ static int aw88081_i2c_probe(struct i2c_client *i2c) struct aw88081 *aw88081; int ret; =20 - ret =3D i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C); - if (!ret) + if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed"); =20 aw88081 =3D devm_kzalloc(&i2c->dev, sizeof(*aw88081), GFP_KERNEL); diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c index 43c03d3cb252..45f70fc78f87 100644 --- a/sound/soc/codecs/aw88261.c +++ b/sound/soc/codecs/aw88261.c @@ -1237,8 +1237,7 @@ static int aw88261_i2c_probe(struct i2c_client *i2c) struct aw88261 *aw88261; int ret; =20 - ret =3D i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C); - if (!ret) + if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed"); =20 aw88261 =3D devm_kzalloc(&i2c->dev, sizeof(*aw88261), GFP_KERNEL); diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c index ff58805e97d1..65f095c47191 100644 --- a/sound/soc/codecs/max98390.c +++ b/sound/soc/codecs/max98390.c @@ -1015,10 +1015,8 @@ static int max98390_i2c_probe(struct i2c_client *i2c) struct i2c_adapter *adapter =3D i2c->adapter; struct gpio_desc *reset_gpio; =20 - ret =3D i2c_check_functionality(adapter, - I2C_FUNC_SMBUS_BYTE - | I2C_FUNC_SMBUS_BYTE_DATA); - if (!ret) { + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA)) { dev_err(&i2c->dev, "I2C check functionality failed\n"); return -ENXIO; } diff --git a/sound/soc/codecs/max98520.c b/sound/soc/codecs/max98520.c index 2bf8976c1828..5bc3d95ade5a 100644 --- a/sound/soc/codecs/max98520.c +++ b/sound/soc/codecs/max98520.c @@ -681,8 +681,8 @@ static int max98520_i2c_probe(struct i2c_client *i2c) struct max98520_priv *max98520; struct i2c_adapter *adapter =3D to_i2c_adapter(i2c->dev.parent); =20 - ret =3D i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE | I2C_FUNC_S= MBUS_BYTE_DATA); - if (!ret) { + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA)) { dev_err(&i2c->dev, "I2C check functionality failed\n"); return -ENXIO; }