Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1CE753126B2 for ; Sun, 29 Mar 2026 13:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774790346; cv=none; b=oLFAIdDCk/7Lryiek/AP3lwhAB0FxK+3MnXIF4zT6RLlZY+TkBEmlDi5lU4jtx4BClGoKp/Ff/TUNyzkejk78Gfi328UK9t+UkkLVfHTeQMZ6gw42tEB7dVHVQ/IYG+ox+bxuPc1aPTq8TKYogC/6447pI2qr6goqHR8AGgDOYM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774790346; c=relaxed/simple; bh=j+vDrW+dvYo4Ln2L9AOtay7keVSKcmuwQsimDidztv4=; h=Subject:To:From:Date:Message-ID:MIME-Version:Content-Type; b=loqRjLkpzMhdce5rPoS1xOe48ihqfYnWQJxvlEwYllIKRcAamW86DOF5xn9KglGjLZ1vzNTLXdu5nyevEeav26bhjwokz5dQDPapcrAX8wbHqyWS0/toIg5S9zogCICWmiV9e0tGft7Rnik5k9FV7J/7AgfJJ5ngLDpC3hLGxZs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rEM/Em95; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rEM/Em95" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FD58C116C6; Sun, 29 Mar 2026 13:19:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774790346; bh=j+vDrW+dvYo4Ln2L9AOtay7keVSKcmuwQsimDidztv4=; h=Subject:To:From:Date:From; b=rEM/Em95nXlLMvY2owZibB1FFIks/AYv2by0OJ8RTVA0pkMi/52Zk2K4JQrxQuoiG a2T4WhlGwkAcY1SphIPjzAfI+341eBrACBwVfWwNnVk3zCDO157dAjtezZ+E5Y+wOj 82NZp0XjhbYxtQuz83HTsLxj9iVHKECzUTVqZ838= Subject: patch "iio: adc: ti-ads7950: normalize return value of gpio_get" added to char-misc-linus To: dmitry.torokhov@gmail.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org,andriy.shevchenko@intel.com,bartosz.golaszewski@oss.qualcomm.com,linusw@kernel.org From: Date: Sun, 29 Mar 2026 14:50:15 +0200 Message-ID: <2026032915-squeeze-scotch-4d68@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit This is a note to let you know that I've just added the patch titled iio: adc: ti-ads7950: normalize return value of gpio_get to my char-misc git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git in the char-misc-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. From e2fa075d5ce1963e7cb7b0ac708ba567e5af66db Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 5 Mar 2026 11:21:52 -0800 Subject: iio: adc: ti-ads7950: normalize return value of gpio_get 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. Fixes: 86ef402d805d ("gpiolib: sanitize the return value of gpio_chip::get()") Reviewed-by: Andy Shevchenko Reviewed-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Signed-off-by: Dmitry Torokhov Cc: Signed-off-by: Jonathan Cameron --- 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, unsigned int offset) /* If set as output, return the output */ if (st->gpio_cmd_settings_bitmask & BIT(offset)) { - ret = st->cmd_settings_bitmask & BIT(offset); + ret = (st->cmd_settings_bitmask & BIT(offset)) ? 1 : 0; goto out; } -- 2.53.0