From nobody Sat Feb 7 21:16:10 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 AA0913806B8; Tue, 13 Jan 2026 11:12:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768302722; cv=none; b=jh3fQFcn2KynBUht92Qn32sKFvCKU9XkiIwZd+ACQo9iD+YdIHWVl2Lbn//NgdSbkNDX6vJG7dn3tXapxPWicav1MXZE/tyhGID5Loi2cLIUyQB3lPlen35Gh5M71wm2TwpXsPjt6LHn0S8dtEQ8ELEblgMrSgEAfyfxqszbsoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768302722; c=relaxed/simple; bh=9KR8a8EWwtSCrpChYsxZtwYb01R33dBd4BXP88bOzis=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=utv9ZdcqOlm6z8AsXIC5zUa3EL5PHSTFUgcSLgyEDve2LsEDgruFOY7aEx5SRQwidec90M7wKxrKTRXB0iElMG+AymFN1R/h9cLCGu+NY7XOE6w1+iqdIbpEI/ovdnEfMpE09bUW7jfJ4vzZlsAJ7pf2Zby2aGud6ZfVqevXU00= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VunshZmN; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VunshZmN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768302721; x=1799838721; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9KR8a8EWwtSCrpChYsxZtwYb01R33dBd4BXP88bOzis=; b=VunshZmNsbsXh40nrPx1MKGqjuEnLqunrzkrnNOzwlujNmhBLm76+Tsb hRK53AY1zSGgqRIxd4U7E7y/FsFyChseYxN6/sT4lz2vKTUR6ULqa++JX zvvVGiv2qlvqPbvld8CQAoIPS5VzaLlOqd8EXGpiBlmS42vyTVXqQLaui dk8xuIn3mE7vGIFeUuyRPCFMkzge3O+7MZqniPcq47p+9ivanXXiEk1em 1XN4SwBrwwT8zJO0D58H2HlzVz9gCUPE5gAq2lOj66BYIdmVwjA0VPBgT wefxUOfOwAmgisBg43VRC5B8DCx+q8PtxsIu9OaUHk4GtPH+bH1xlCy3q Q==; X-CSE-ConnectionGUID: 1ddqgCfoQ16njq4scfkacg== X-CSE-MsgGUID: jnyQEDn7S7aQ03FqkzpIjg== X-IronPort-AV: E=McAfee;i="6800,10657,11669"; a="69317382" X-IronPort-AV: E=Sophos;i="6.21,222,1763452800"; d="scan'208";a="69317382" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2026 03:12:01 -0800 X-CSE-ConnectionGUID: aTxu/0rETcufZbP23+1SEw== X-CSE-MsgGUID: x2SzvLkqSZG0/BxZMAyKMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,222,1763452800"; d="scan'208";a="204965218" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa010.fm.intel.com with ESMTP; 13 Jan 2026 03:11:59 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 3A2E299; Tue, 13 Jan 2026 12:11:57 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v2 1/3] gpio: pca9570: Use devm_mutex_init() for mutex initialization Date: Tue, 13 Jan 2026 12:10:52 +0100 Message-ID: <20260113111156.188051-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260113111156.188051-1-andriy.shevchenko@linux.intel.com> References: <20260113111156.188051-1-andriy.shevchenko@linux.intel.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" Use devm_mutex_init() since it brings some benefits when CONFIG_DEBUG_MUTEXES is enabled. Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-pca9570.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-pca9570.c b/drivers/gpio/gpio-pca9570.c index c5a1287079a0..eae35135c71e 100644 --- a/drivers/gpio/gpio-pca9570.c +++ b/drivers/gpio/gpio-pca9570.c @@ -115,7 +115,9 @@ static int pca9570_set(struct gpio_chip *chip, unsigned= int offset, int value) =20 static int pca9570_probe(struct i2c_client *client) { + struct device *dev =3D &client->dev; struct pca9570 *gpio; + int ret; =20 gpio =3D devm_kzalloc(&client->dev, sizeof(*gpio), GFP_KERNEL); if (!gpio) @@ -132,7 +134,9 @@ static int pca9570_probe(struct i2c_client *client) gpio->chip.ngpio =3D gpio->chip_data->ngpio; gpio->chip.can_sleep =3D true; =20 - mutex_init(&gpio->lock); + ret =3D devm_mutex_init(dev, &gpio->lock); + if (ret) + return ret; =20 /* Read the current output level */ pca9570_read(gpio, &gpio->out); --=20 2.50.1 From nobody Sat Feb 7 21:16:10 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 2872B36C0D0; Tue, 13 Jan 2026 11:12:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768302723; cv=none; b=rj6RaGTqqviuV5imokBmFjkEU//jamjgymHBsFrfCqh28ApeS1QeBaYrNx8YWxEmkJWI3xXkYhj1L2WpAqhsLpekl+HPSol8mkHQLOQncDcnMNycI+FPeVKvFUIyXQn1omtbgEdCqzkJAbw+YxADKyFv5Zx5zNqWfqPIjWaYysQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768302723; c=relaxed/simple; bh=u4Rdy1iND+SQoEj1+HDPkD77EJiwR+s8++mQkv1dSNU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i04stNv+JsSysI6zShDegFcuT0pEU6S5KPLmiuOVkGD8gu6lA2PsD/I/wSEF+zA+wo8a0/mHFgh7/Fskkrvs2Ask14utrm5nPTyooDAZSYtqzWvEoiWQVyZNce31wBfKt7lwhDmbWUFVgVcXkGuKhEOFZFhl/2IbvIhBpy+P8c0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HqzXszSc; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HqzXszSc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768302723; x=1799838723; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u4Rdy1iND+SQoEj1+HDPkD77EJiwR+s8++mQkv1dSNU=; b=HqzXszSceUPrCr0A7dEBMYenv+gE9sXPOqqv0Vm57ydGHCsWRiaAFZd/ Om5RwKGgXi7tdoPxhJiznCxKU0KnhKxc84u9xAGMKwtVc7gCyftnk8hJm 0IJcNBE8EnUaAm/oWEACXbpGnpN67L79YMaQamHCb3uvG9a2SVvHXfHCc okLBLcsWJ23wxOUS5zkKgA+JC0a4SLzxJ3ZpzSBt6xXhTLy/ubxBXLcPm D4ryY2IlXopo+qZhQ14H/oh8TqmAJoAg34ZADwAe1xxhQ7tllvhJxonyC p7qceUErxrS4Nw0LFHCSbV0zm0YeA/wNdLF1/4c1Tr5E3cu9haQwTl9dW w==; X-CSE-ConnectionGUID: 8C5QaQC3QcaR1nmx7av+vw== X-CSE-MsgGUID: 39F0aGktT6Kb5FO91EnFuA== X-IronPort-AV: E=McAfee;i="6800,10657,11669"; a="69317380" X-IronPort-AV: E=Sophos;i="6.21,222,1763452800"; d="scan'208";a="69317380" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2026 03:12:00 -0800 X-CSE-ConnectionGUID: dRu10CMoS12B6YwIt1D/bg== X-CSE-MsgGUID: /U//8FbgQL26fWlvsJCNQw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,222,1763452800"; d="scan'208";a="204965217" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa010.fm.intel.com with ESMTP; 13 Jan 2026 03:11:58 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 3E56B9B; Tue, 13 Jan 2026 12:11:57 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v2 2/3] gpio: pca9570: Don't use "proxy" headers Date: Tue, 13 Jan 2026 12:10:53 +0100 Message-ID: <20260113111156.188051-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260113111156.188051-1-andriy.shevchenko@linux.intel.com> References: <20260113111156.188051-1-andriy.shevchenko@linux.intel.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" Update header inclusions to follow IWYU (Include What You Use) principle. Note that kernel.h is discouraged to be included as it's written at the top of that file. Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-pca9570.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpio/gpio-pca9570.c b/drivers/gpio/gpio-pca9570.c index eae35135c71e..a41837f1201b 100644 --- a/drivers/gpio/gpio-pca9570.c +++ b/drivers/gpio/gpio-pca9570.c @@ -9,11 +9,15 @@ * Andrew F. Davis */ =20 +#include +#include +#include #include #include #include #include #include +#include =20 #define SLG7XL45106_GPO_REG 0xDB =20 --=20 2.50.1 From nobody Sat Feb 7 21:16:10 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 B387F3815E1; Tue, 13 Jan 2026 11:12:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768302722; cv=none; b=qoKFtMd+7FluVQb1lmxWCTGGElDbMg42T4SVhcvByAA3/bRaoJ2rVlr1dKsRrZne335BG7YaYO9538OX669v7sTfFTjhgZW3ZxBRbtPbD4EiLmtGS14V+kvhJXXgGh8m4Iuo31fAdIL7KS4TDQIyxrAqjWTUq16dq0yI5q7/OR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768302722; c=relaxed/simple; bh=uYNUANscJVovmvcNvkxRxfD+1UaN1bScHH+xIH19yk0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SlRSWjsj9k+A5EQx0JY0gnwkun2dbWmKXMWmSvT+RKDjEqt9kMD2PujuqjejPcDu8nB81xJGIAQZp15LGHVy/TM0fGR4Xp0YOjqWjvOj1naXSAnkZ+3JT5iZ2rcuHw27FNQrYU+UdfNv318PedW8Fy9khd0Ct8X9shjFb7ONNGw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fZkwnRQq; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fZkwnRQq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768302721; x=1799838721; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uYNUANscJVovmvcNvkxRxfD+1UaN1bScHH+xIH19yk0=; b=fZkwnRQqkJdCv6xUGiLwFLKmrNlM4j6mkGMyTacAzmASH6TIKFTfoZPt KohSxxJlY48PbfJcR8PJ5kB2rymlpD+ItFi5W/dFP4+aVItqPMYouzXqF UWBHcEu3aJoltuglCMrBV+/jOFN4wegG7v8JaootkEO0A0Sp48TwF1WIR PrmzIuWCxf1xWxPQX93cvNR4GIxaSrn0Gqy3lalAaoThyEuiDXY2E07UL uGJOfNk0eDTyCWyQCDwDNvOgRTCW6SRG8RCzXWmbdoJbOvY5MKYC1BTZW cvmoCZgXy6fdd10wmZd1OK1R/guqqZQPGKg2SydrAPfoA6DhR+Wk8mL+c g==; X-CSE-ConnectionGUID: DhaDMddkTDuXY13XH/ye1A== X-CSE-MsgGUID: VBwt7T8URber3r+THkpdVQ== X-IronPort-AV: E=McAfee;i="6800,10657,11669"; a="72166541" X-IronPort-AV: E=Sophos;i="6.21,222,1763452800"; d="scan'208";a="72166541" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2026 03:12:00 -0800 X-CSE-ConnectionGUID: N8WsbxyhTWSRv8tGvee7/g== X-CSE-MsgGUID: 8R8mXT0mS2icVlczi4zpuQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,222,1763452800"; d="scan'208";a="209414889" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa005.jf.intel.com with ESMTP; 13 Jan 2026 03:11:59 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 4260C9D; Tue, 13 Jan 2026 12:11:57 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v2 3/3] gpio: pca9570: use lock guards Date: Tue, 13 Jan 2026 12:10:54 +0100 Message-ID: <20260113111156.188051-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260113111156.188051-1-andriy.shevchenko@linux.intel.com> References: <20260113111156.188051-1-andriy.shevchenko@linux.intel.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" Shrink the code by a couple lines and improve lock management by using lock guards from cleanup.h. Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-pca9570.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-pca9570.c b/drivers/gpio/gpio-pca9570.c index a41837f1201b..4a368803fb03 100644 --- a/drivers/gpio/gpio-pca9570.c +++ b/drivers/gpio/gpio-pca9570.c @@ -10,6 +10,7 @@ */ =20 #include +#include #include #include #include @@ -98,7 +99,7 @@ static int pca9570_set(struct gpio_chip *chip, unsigned i= nt offset, int value) u8 buffer; int ret; =20 - mutex_lock(&gpio->lock); + guard(mutex)(&gpio->lock); =20 buffer =3D gpio->out; if (value) @@ -108,13 +109,11 @@ static int pca9570_set(struct gpio_chip *chip, unsign= ed int offset, int value) =20 ret =3D pca9570_write(gpio, buffer); if (ret) - goto out; + return ret; =20 gpio->out =3D buffer; =20 -out: - mutex_unlock(&gpio->lock); - return ret; + return 0; } =20 static int pca9570_probe(struct i2c_client *client) --=20 2.50.1