From nobody Sun Apr 5 18:17:28 2026 Received: from mail-dl1-f49.google.com (mail-dl1-f49.google.com [74.125.82.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2E2872618 for ; Thu, 19 Feb 2026 02:29:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771468179; cv=none; b=UrabIXxHUvZ0GtxEet73RBNuEc8XkABsTWznqF8HdhI8PC0isi71Ka44g1WgPr2RYKVbW43BnrBJWez0hCDhr/aWMMQ1tcrDGaiCspEznMVGxuq5nhDX1Xos4bjJxf4rBtZvqdGUhTBU1Y7Em1Dx8ziutsASV+mV6dd9D3SsLnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771468179; c=relaxed/simple; bh=U85fY+I300/oFLus60isN6QH9G2vXciZReaIa9B6Y1M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BV9lVrUmG030pCCv0UuEpED2/2lpTk9FTo38uZYnky+wMmk3mKb2wK+kEia6FQipXJXfGUGfsOSUczeCyAyKw1aDNzuVNUBvRIF4SZV6Zk0RaZGKgYlaqti+G/2Y+O6XZg/jTUXbCjl8rCt+Q6rb2P9W/YflppAsNigZvwoq4Dc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SkuWoMtM; arc=none smtp.client-ip=74.125.82.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SkuWoMtM" Received: by mail-dl1-f49.google.com with SMTP id a92af1059eb24-1275750cf9cso422945c88.0 for ; Wed, 18 Feb 2026 18:29:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771468177; x=1772072977; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DP7f7+vHuIRyxHFGE/u5+51f2GQdsjDkgx7ouhpfqiw=; b=SkuWoMtMkKT50I6DZMWwuI/wpFLK5pzabM7nDwjG5Ku4xxplFaEeMM3Mv/d4hXR+19 pqlfyvpj/h08XgByAVtMcwTXnHIIxrc5Qn2wpp5YKyNbk6l8+OYnC1pd+i2vSI40Iubk zynCla9cmjgWM0uU5lCAzZoLjmuyt6b0eCC3clnYyDHDUzlZMj9UzXICpxpdHjkNjN2G tKB14PDldLCd0w/O6iiJ98tTU9PXXMtQIBsaQ/IXs2ABZECETwvlHyOHBiBqjNzuobvO EoUfqn33gO2JVsMmQckcEOp6Vtj9GCVNAsnr5v4fi1t6JD8CDuttpEb8ptXu9wILqI09 4SQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771468177; x=1772072977; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DP7f7+vHuIRyxHFGE/u5+51f2GQdsjDkgx7ouhpfqiw=; b=WWy0A+ayPntWv20up4F+RuedjtBn3Cdl5OTtduNFWKvgb5/Ru9wK1fsJ8XkLXqyaJc xbtlECu6jekRxHuMHSAZxHQLIqM0ZerEJ96JWkTIq8ITzWtZSihOsC/svrvUdW0eMNOv 2lRiMi+UN6IdUto62AMl2ZqutOTYKrIriGS8yaID+8LgB4mclCPJ3vETj0JuZ7fAGuxy nm0cRuGKgxYSsygXK5MWKiIyV6UuwRvLqdlCChGLL8IjfAzvV6MU6CLRMHQvqnaRgBbM kHP8trmqGoSZtn9L7oXUQ/bmaDJFcwuTJNFhMPnQrV33Jm7q/RYRB2+lxmnbn2WYouJ5 ksoA== X-Forwarded-Encrypted: i=1; AJvYcCVykl/RlU+rniHtz4+394AhNWak9Hcet/61CpIbPen4dKUgnQpkddfqDFstetAVnV8ouHB8V+1qzKXgW2g=@vger.kernel.org X-Gm-Message-State: AOJu0Yw47Kssohi15ivTGq6jCOXWwnoylUeV1P9hGCNHvHGeDBjtOvhY Uedlbm9TNNP6kONFR9sHuJRuXRG2CuSzKiiqGV+DNm2myWQxpQf3nwz6 X-Gm-Gg: AZuq6aLhHW9Z+RRz+aqoT6PpevLnlbWy6ncQJLMHooAdDXgdlfrqE6IF9CA2sZupPbV TazunEK8e7JIjVebqZ+mCJ37zmOaS/+IMi96cCfA46YkTWDkrNh8zdkGKq2O0JsZzeuqIGa76Fn s1sqPH96Yxrc3PtwsxENT100X9jcjNiv3Kcc1QugzPhcAGYJXgkdynW9NQrXxQbsyisKQ3G7xxw B0xAE4D68EDhkzZtTiwGZKHDWEO++umeAWe3044e6laLFGWzzqUIzXnmB0TC+yaKz29bEa8cIvP adjkiJLddsjIXkPGey9LxZ/bAlA0EjcGp1KsJzeDgNfCEV7SgLtlzjg2N6g535XAaHWvHHdNhZw L7YVRdV8oCEU1o4QIhxsGoNR1qtGoR4DwjzmxGSOmaPo9pm+MGxW9bt3NaHeIhutcL3blLStQkZ y8JNKvaXBw1Lx06R3MXz1SmqqRhnLh7eFw7IbrzKAKFFiFY/XE4DtVjW7jVBgQ66bBnJ4qypnVq 7xH1c16myWcYAM= X-Received: by 2002:a05:7022:6b8e:b0:119:e56c:18be with SMTP id a92af1059eb24-1273982a33bmr6911896c88.38.1771468176909; Wed, 18 Feb 2026 18:29:36 -0800 (PST) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:265b:f5ad:9e03:677e]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bacb577bcasm19609433eec.12.2026.02.18.18.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 18:29:36 -0800 (PST) From: Dmitry Torokhov To: Jonathan Cameron Cc: David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH v2 1/4] iio: adc: ti-ads7950: normalize return value of gpio_get Date: Wed, 18 Feb 2026 18:29:25 -0800 Message-ID: <20260219022929.3558081-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.53.0.335.g19a08e0c02-goog In-Reply-To: <20260219022929.3558081-1-dmitry.torokhov@gmail.com> References: <20260219022929.3558081-1-dmitry.torokhov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The GPIO get callback is expected to return 0 or 1 (or a negative error code). Ensure that the value returned by ti_ads7950_get() for output pins is normalized to the [0, 1] range. Signed-off-by: Dmitry Torokhov Reviewed-by: Andy Shevchenko Reviewed-by: Bartosz Golaszewski Reviewed-by: Linus Walleij --- drivers/iio/adc/ti-ads7950.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-ads7950.c b/drivers/iio/adc/ti-ads7950.c index bbe1ce577789..b8cc39fc39fb 100644 --- a/drivers/iio/adc/ti-ads7950.c +++ b/drivers/iio/adc/ti-ads7950.c @@ -433,7 +433,7 @@ static int ti_ads7950_get(struct gpio_chip *chip, unsig= ned int offset) =20 /* If set as output, return the output */ if (st->gpio_cmd_settings_bitmask & BIT(offset)) { - ret =3D st->cmd_settings_bitmask & BIT(offset); + ret =3D (st->cmd_settings_bitmask & BIT(offset)) ? 1 : 0; goto out; } =20 --=20 2.53.0.335.g19a08e0c02-goog