From patchwork Mon Apr 7 07:21:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 878806 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 6E2B022B8C6 for ; Mon, 7 Apr 2025 07:21:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744010487; cv=none; b=lwNuaZtPu6kPll2GRW5HrNQEyCGUNFIB+T7WD2hOq8q2TNLrvwrLLgb3M+CDz9A95KQwtCbmggs5osXDVfnwfqr3nkfVMXiKM2aSo+vmG3MNFK/Ev6jJ+63HTQGAHiJu4U9+z8wU1nQunHufaBDLD8QXDhg3xvL1oH57yX3DNqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744010487; c=relaxed/simple; bh=NYalEJMMKkwM5Ww4yh68/Dbtgd+QTQUq4aOgUJNHaQI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MAS2bbVE/AjxpjzO5150RMaWkWPeHteCj52+XgX8eLyGK1+ewHQULhyTmQe7o+jvUI7+Qf+KrKOpx5XuhnN5uM4W3imufPqAUAOblPPIM1ASyc5IOe0TCKQ2kJtkfFC67zLOlEEbgGhMiX9hbAC5Yip0ge+A8iqcY3Wa8k4bAio= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=KCJZJVK2; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="KCJZJVK2" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-39141ffa9fcso4493339f8f.0 for ; Mon, 07 Apr 2025 00:21:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1744010483; x=1744615283; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VqYc0+h72+XOfzEYrjjYbBXS836lkHNvrPwnLM/zXmc=; b=KCJZJVK2/JA5wuwxf7A4bgN46RO/tJVg0A+Uaz7ym1swbuqoQ4pL+lJZnv+I00YWlV o3q6PY7iYklWmuys6qNRFXXuakEOit0y0WrFdjwbr8bd7Db9jqpeVZ2YYpvin8cPwTYZ a7uAFbJnu4sQrLwNQrGrm4HFiMTsyEVw4xGnrILEHinLeGH1cH+izchjK2mGGmZaEd1F vngJ3+x4U1L3kY/WHUrR/exNOcmTzFQSozKw7L20w6WAqQJW4qPDW2/RwREJjFewQyjw GpklP8fj8EGliZ5ELj0E7hBLsCnIi1fDbLh41ab+sT0liMiOP0wRIeEQZJe7DrYWCi/J cbeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744010483; x=1744615283; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VqYc0+h72+XOfzEYrjjYbBXS836lkHNvrPwnLM/zXmc=; b=gjNzur3vdFVq3KZdVDVnfxhh9rO/kH7Xgc11cMKGxUfo7pw88Gw2Faf0PmAvstlsgD /Jo59RUyAKu3m0ifVjjjGgiex7lr9NYlEV4U9edfd4UQrlk/2Gb+3OtnrM35nwlJv/mD WmtJvXbQaLb6D9H+nAA1G4XlbrXvM7ZvkM6MOmsRV4yLls17jkyU6fq5g8MJs/1bd5i8 rM3vPEKPm7De81y4Zin0u2ThhrAme8bnmx0iIBZrWpBSddI9+YNtZOpL0zPyBhr9dwST FNGqHw2pRwPyvq42whtF4srmqapGzNegz1LIgWzy55dGImDKCXbNzB+qejIJUrbo00L4 4zbw== X-Forwarded-Encrypted: i=1; AJvYcCUNWBNAOF1kFAX3Lxx97hVBYw+rPfiqrhDeQu8+vDaov08i7nidqlQbwALB9tNuxGSuQH14vTB46rRK@vger.kernel.org X-Gm-Message-State: AOJu0YxAYMKMztNvOGK8KQhRK9dcCl7nh0BmC17u+dPOD5G7VF08Ss2v CDSq1Q+bVeSltBMqGheZOo+/2hIRr3Cb5H6BKex3layMYAGmAMTwNbSS90blPu+C/mOrLKW1oRj Q0Y4= X-Gm-Gg: ASbGnct6g/qmMO+ZSOYRhEyRIMbN3j0S31RIY1SKdapOMzgWWJ92qUfCJkJI0+fTq7v DrdMMewxleekmLoKJRmjTc2c7zjAQ4jFL2S2svSGRPs+ot/MgyP2Ig+/UpRTM7Ecr64XoCUCq6t fbzwLMeE1scqdXuYb5SlbXYvqSRhVNgzlcfQlL5ZoK02+X0LT5JxLkbKXqsHLP6X/j5YjyB5oVA 6veslV3hwdcsA4yhALlRN7kISAaDyG9nE5oXBEd8JnpIsOqi1/kVmTXhwB+W9Sb3yaaJZ9mvduh jB1AZVGgfeRfTCP4zoiQk8VwSj3yZJ6leFr21A== X-Google-Smtp-Source: AGHT+IEylLp0D01gBNPQYuFsaV4Jo8rU+Y22RzbkmwIC8AAPBDzAqbMk4wdqcSVUg+5yIspCNTHcKw== X-Received: by 2002:a05:6000:1447:b0:39c:30c9:815 with SMTP id ffacd0b85a97d-39d6fc49b7bmr4954083f8f.21.1744010483553; Mon, 07 Apr 2025 00:21:23 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:8c64:734d:705a:39a7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ec34bbd9csm119983655e9.20.2025.04.07.00.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Apr 2025 00:21:23 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 07 Apr 2025 09:21:19 +0200 Subject: [PATCH 1/2] memory: omap-gpmc: use the dedicated define for GPIO direction Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250407-gpiochip-set-rv-memory-v1-1-5ab0282a9da7@linaro.org> References: <20250407-gpiochip-set-rv-memory-v1-0-5ab0282a9da7@linaro.org> In-Reply-To: <20250407-gpiochip-set-rv-memory-v1-0-5ab0282a9da7@linaro.org> To: Roger Quadros , Tony Lindgren , Krzysztof Kozlowski , Linus Walleij , Bartosz Golaszewski Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=806; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=W3DX/G7SfvWTY6yhl3JHraQx6MB7aIVZCQYoNdF4OR8=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBn83zxJSSL5ijCrjtatIGOOA7cJetXi6ApKG6BS DnLE57D+cCJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZ/N88QAKCRARpy6gFHHX cmxyD/9vrVD45lvCtqQR34ByKLHJguNZHFOLXIsO/zXYrKeQptI54MwWfVo0VZbGTB+Cz8hn8CQ E+Sq2eaJbEk/2wKaoYlgYaQ733hwqdJVS0N3nFZ5wnYIOF0UFflwczQbn2mGZPIitpRA5zbD/ZA IdgBaK4+B15XnDyHzQNPRHhnnfE07WhC1sf2jAvTVDaAatpas0Qp2rDjtC6ND30+te3izE9vIyE IHyuw6JAWCBNQOlhQi8J46NuTc/wQrVQySG/SyOcNhaJifApA5ktHTceJo4QQqhWVdnKPEVgsSm 7XAdvEzI9pykGIviK2Fmeiom112dSNFTc4lQdrBlEXiixe9IoB+oDHcfMkRjiiKYEIj9FFSSmco iGu7mQk6LiHwjxctfUdVJvV17lMxS5YP5r0xRT/aDNwCPvvqhBSg6uQC4CiMqmMWUXYbvZhpShW NHr8/oz0VVd6T3agK8Jvsp/dvejkqG/cEJ2WvNCGnQJ0Am+EQ9sZ5zcUe0FBO7fItwgZMBDx090 57aX8JezFk0Fh18o9T5u/Kecs0O3ek+M61z0/LzScugP3nU9+xlBtwbZXZQcJ32IYRlZ8L0JlBE q8STH8oyRsAGXZjwdDioGPqBsRotEXT//qs+D0zqSYFXOySpKWF/ciM+usfQECZsEk1YseebFKy 7Hy644u1zExqB4A== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski We have a constant defined for this purpose in the gpio/driver.h header so use it instead of a magic value. Signed-off-by: Bartosz Golaszewski --- drivers/memory/omap-gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 53f1888cc84f..d4fe4c5a57e7 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2376,7 +2376,7 @@ static void gpmc_probe_dt_children(struct platform_device *pdev) static int gpmc_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) { - return 1; /* we're input only */ + return GPIO_LINE_DIRECTION_IN; /* we're input only */ } static int gpmc_gpio_direction_input(struct gpio_chip *chip, From patchwork Mon Apr 7 07:16:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 878814 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 64F93226D1A for ; Mon, 7 Apr 2025 07:16:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744010184; cv=none; b=oQkOfficMJMV4PinnE63p4yi4NKGfs6zO2WaOwLTfSR/XoKksuDFUauQZI9Ds9rZXXxlkdiGC3bcBvq4fPziw85uvtuNuhQYg4QZt0k9e4puxsk7tUyBq/pEzmNnwqEELbXsDQp11J+Js8XDurdupbGxDYmFoYTMVbNkGDeoNJE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744010184; c=relaxed/simple; bh=+lVN69TWmBJGkcCx4RTC68T2V1dx9edleF2Xorkmk58=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tnyVdFilJ97qZ2PTkfhk5ykZOjO26Ti28UExUed9dU1YTKn9hpyxeMUy89XA1Lsc53LIkRd+8u4LIOadmZ5+EWP+qDYjeEPv1dluwvFlUSS1rKfeLUF6G8J8PG0PJ4dVW1hH/iPa+1UvnRbiEAlXPkmzTkKc+SeZlcZODQWO894= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=ZVBPpOKU; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ZVBPpOKU" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-43cfb6e9031so37151165e9.0 for ; Mon, 07 Apr 2025 00:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1744010180; x=1744614980; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=GzYz0IrNb1aiDrsSJo07WBOcsPBauEosyVEV2lACwJU=; b=ZVBPpOKUwPdzc4MAAf3QhRUVFiMWxaB0/J0WfxlJ1909UJsRm57kr2buVus+B9rRXE +FOPMsko1J2V0FJv9w/7GjbArzfQvyjdonqT22iMXLxVzvfn3IddfV5iFyzTjuj5V1q0 upXBo0GG42yqYfeSd4LESsxjYTE/hbTHykq6MI6EvXaJ6tf10W7SHxrMlgZ37rbAV1o/ gQFGawWxBnXwE0A0cgT2IXuto+GQ1CK5sEpPz/b9AH2d+grn96xHb0pnpRPkFoxiwSnm QPmgh5UK8GhLhcbNk8CSEyeWMjv4auKtCDknkxZAL9u2+pLuU8oSt0UKnj8HOG878Onb +/0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744010180; x=1744614980; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GzYz0IrNb1aiDrsSJo07WBOcsPBauEosyVEV2lACwJU=; b=RcmvCXxt5kmCVF02ADSosd1MY5IwVqOc9KN0Bhf+JUOaWnjnb6niOOm6QFXaIji9VL 1hdR5t4MtAqZW4aORljvft69WTQK/62f1lB0yv/G1G5bFZPi9AhEavTtFZ5bnxN8m2Ki 8hhpMulBOpVpzNrtvGkR7HxYUNR03k5twF33G3bhNiXwPl/Xh2LGyFsXCChQIJ7Sj6mo tB+ybxZQfgl2BiMtIp/aK58dlihoJLgMPWnafSMiQ32DcoRc2f4Fa3L4ScikjhcUkR40 o23wnQMvITSMKeDzB40GyHLRCMic4BklLrFiPIn820bGkU0ZJ1NgN24P+gvLmNN2voB4 XbaQ== X-Forwarded-Encrypted: i=1; AJvYcCV6JF98dzgEV51TWp/eLTGsOXeXTEIv+5pV5kGpPC4IA32ZbSJm9hUPj1db9BFKvE5q9Du+CRaAhq3r@vger.kernel.org X-Gm-Message-State: AOJu0YyUkM7Nlt6mJEmN9wzx699/uEq1kgfl43YI/CVWTAK3pQDUXWmT INNlnJcNPNlq5QmEOFzCZkSMqbFqyTb9TAJHOhxpjQVUUCdmpcjjiDF5x2/nmho= X-Gm-Gg: ASbGncuCE+zbE45uxZUNA/j/8QYYYP7LOAzW/bTW79w4p7N2oB9ZDSxkjJ/Rwm5HRQn sUTwRMJTmZ9wKkWFH2B7bT0oMHJPu1RGSzVN4KTnUSvnv/bmuVvOBw8E8UvaioR21K+MnrmuzaM 5HeunDrehev6T91v42rwG6BFT/7Tnj80gqL51G3OPjiuOp7XtWH98iIJJLXCRci+PF4mdi1/9Ss 35FgOe7pdaH9hXMWXWR/b/uxmNnRm8ViTlN9AXYi/Zr/mHlut0l1RS8sskErQc+p1UwOHpdg0Rb Vf1QR6A0uCWVMwB79TEsIAZhMJxTDgoVW3X4rA== X-Google-Smtp-Source: AGHT+IE8TYDZRnZ10si9IEbVCRrw3jYRuGhAUnbXwYdDSJ2w1xK6P2L+5C7YzmeuYk3QEjBUh3buGw== X-Received: by 2002:a05:600c:45cc:b0:43d:fa59:be39 with SMTP id 5b1f17b1804b1-43ecfa19d6bmr74584255e9.33.1744010180653; Mon, 07 Apr 2025 00:16:20 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:8c64:734d:705a:39a7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ec364ec90sm120728725e9.27.2025.04.07.00.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Apr 2025 00:16:20 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 07 Apr 2025 09:16:17 +0200 Subject: [PATCH 2/2] hwmon: (pmbus/ucd9000) Use new GPIO line value setter callbacks Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250407-gpiochip-set-rv-hwmon-v1-2-1fa38f34dc07@linaro.org> References: <20250407-gpiochip-set-rv-hwmon-v1-0-1fa38f34dc07@linaro.org> In-Reply-To: <20250407-gpiochip-set-rv-hwmon-v1-0-1fa38f34dc07@linaro.org> To: Jean Delvare , Guenter Roeck , Linus Walleij , Bartosz Golaszewski Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2406; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=lT9LPgVcdHog5NKMsZeYq1JZn6VFGMZndrir3r18U4Y=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBn83vCqvelR6492PjchFZZRoSHlU+ZhyIQkbCAi C73EkHOFW6JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZ/N7wgAKCRARpy6gFHHX cng3EADUg97oz9I2TXygVlGc1U9x9LK/8rlGl/jqTG6LheeWfX7J3EEzlWFXZfpPqbkFkmfV8wU DbVpr7KLtP7c5csddJS9nXfNEsVgUQyyGXda1Ebl9mwp52cW30ksqbggYSGDdGEB0HGqUmfxYk3 m823XzZgo6I0cGW4Nu0mXGQYa7zYEzqBwUxUnlwD5AuertOLIvY9QX/tyEqgZFBaDYH7pS1NCFv QScrGVh9EfQVw1UQja2OAV4mNaS2T+Imv5tJHhVfnQMjME5Fry6rLPluck1n5HTSYQwzbxq1gvZ 1bucSP8YkAA80DsXfuO3sLdbyuoNfrT1AGF+ctPMNpOatseRBEv53H9yV+HMDIq5Bx33LRTarPq WmQxc2i7IUTZF3b2S0TJxXwR91G11XLC/gBcUOD/48oTnvxQ6K/lc+Bcuj5k69ZxD24rGK390bz y3xtMwrdnf2IcXj8sU61NuCyqYaprm+LS1fI9l1Tk71h2n3eaLxjOaNb8iMdrVF98xSzMAIgoRN REEmYF4Ja5Ul78RibwlXRKJCk6OM0HfgeGiWd3vpnw2doQOrHLkpgIQmduQf8NiNw6Drdk8m2Ys g8lWedA8sSZgR1RxfrQdwXiTVvmxIviO4hGS2zNa3eh3GYgDiy1zPpXSAWpwN/HOC5jIc7YJKA7 brtDUlwn9DxuD5Q== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski --- drivers/hwmon/pmbus/ucd9000.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/hwmon/pmbus/ucd9000.c b/drivers/hwmon/pmbus/ucd9000.c index 9b0eadc81a2e..2bc8cccb01fd 100644 --- a/drivers/hwmon/pmbus/ucd9000.c +++ b/drivers/hwmon/pmbus/ucd9000.c @@ -212,8 +212,8 @@ static int ucd9000_gpio_get(struct gpio_chip *gc, unsigned int offset) return !!(ret & UCD9000_GPIO_CONFIG_STATUS); } -static void ucd9000_gpio_set(struct gpio_chip *gc, unsigned int offset, - int value) +static int ucd9000_gpio_set(struct gpio_chip *gc, unsigned int offset, + int value) { struct i2c_client *client = gpiochip_get_data(gc); int ret; @@ -222,17 +222,17 @@ static void ucd9000_gpio_set(struct gpio_chip *gc, unsigned int offset, if (ret < 0) { dev_dbg(&client->dev, "failed to read GPIO %d config: %d\n", offset, ret); - return; + return ret; } if (value) { if (ret & UCD9000_GPIO_CONFIG_STATUS) - return; + return 0; ret |= UCD9000_GPIO_CONFIG_STATUS; } else { if (!(ret & UCD9000_GPIO_CONFIG_STATUS)) - return; + return 0; ret &= ~UCD9000_GPIO_CONFIG_STATUS; } @@ -244,7 +244,7 @@ static void ucd9000_gpio_set(struct gpio_chip *gc, unsigned int offset, if (ret < 0) { dev_dbg(&client->dev, "Failed to write GPIO %d config: %d\n", offset, ret); - return; + return ret; } ret &= ~UCD9000_GPIO_CONFIG_ENABLE; @@ -253,6 +253,8 @@ static void ucd9000_gpio_set(struct gpio_chip *gc, unsigned int offset, if (ret < 0) dev_dbg(&client->dev, "Failed to write GPIO %d config: %d\n", offset, ret); + + return ret; } static int ucd9000_gpio_get_direction(struct gpio_chip *gc, @@ -362,7 +364,7 @@ static void ucd9000_probe_gpio(struct i2c_client *client, data->gpio.direction_input = ucd9000_gpio_direction_input; data->gpio.direction_output = ucd9000_gpio_direction_output; data->gpio.get = ucd9000_gpio_get; - data->gpio.set = ucd9000_gpio_set; + data->gpio.set_rv = ucd9000_gpio_set; data->gpio.can_sleep = true; data->gpio.base = -1; data->gpio.parent = &client->dev;