From nobody Mon Feb 9 03:45:44 2026 Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (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 BF1735D73A for ; Wed, 13 Mar 2024 23:54:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374075; cv=none; b=C5fjKW1HjT62LutGfipEtNuOqxSUYmVfQPvEHeJI7j2FmnmwpyH6rrXNDmG+YTHnHBqrXeHM+9ryNQrxUufVqDocGhpOAEwNARz+0PgRZhdZMKZGNvu4WdzDhtjrViiZd0w/mudDL5cLOFY+ecDuu6a7ehGS//+ftNoAB2XlBus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374075; c=relaxed/simple; bh=4haKc0BWmXZv48XAJVDKU0krU0tVfIaoXXWWf/W8YnQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Unb7JQ9BwaaB4GdhQGs1Y1NVkhvcjuS5h/c8C9dKSxdGeq2pLTwvciNhpSSjrWTTEg+X1+WkdWRgUzle8Y1v+LExY0wkEL8KVKvzXUOr/y8bpPz4EBcOznWW4R4zAxuif9wP3Wg2GKutMZzBUZlN8WLt+M27LAvXIwcCFOAfLNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id 05614ad2-e195-11ee-a9de-005056bdf889; Thu, 14 Mar 2024 01:54:25 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 01/11] pinctrl: aw9523: Destroy mutex on ->remove() Date: Thu, 14 Mar 2024 01:52:04 +0200 Message-ID: <20240313235422.180075-2-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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" If aw9523_hw_init() fails on ->remove() the mutex left alive. Destroy it in that case as well. While at it, remove never true check at the beginning of the function. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 4edd371c469fb..66629af0b88b4 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -1067,10 +1067,6 @@ static int aw9523_probe(struct i2c_client *client) static void aw9523_remove(struct i2c_client *client) { struct aw9523 *awi =3D i2c_get_clientdata(client); - int ret; - - if (!awi) - return; =20 /* * If the chip VIO is connected to a regulator that we can turn @@ -1082,10 +1078,8 @@ static void aw9523_remove(struct i2c_client *client) regulator_disable(awi->vio_vreg); } else { mutex_lock(&awi->i2c_lock); - ret =3D aw9523_hw_init(awi); + aw9523_hw_init(awi); mutex_unlock(&awi->i2c_lock); - if (ret) - return; } =20 mutex_destroy(&awi->i2c_lock); --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (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 E08FF5D73A for ; Wed, 13 Mar 2024 23:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374139; cv=none; b=Hk84plPrOsgrfrVCM/A9Q6zUTwsSJBJYyVaoUEECz/RkgjYMSM/POLpP/yvFrlihte8HR5icAmf/AS+518caM5AZC2BeR6zDOBzQPjAtr0yjc0PkMeCOsQoOXdQtClcK59W+hIXVzO8QvGdUcGhp1X8qLpD28Wo8AIm00j994Ww= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374139; c=relaxed/simple; bh=nSF/R8gYLxY6alFA60B5rOXw4QyV2pEDvssncoOLngY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NB9HoJKFrd2URpCT3lgUy/fiBQfdCiEwt+dVF/MxA9KqB1t/xYPwYjeNxHLkP7tXUsLqZEj62ipunDOwmZdG/7IwQgFtm0xL07NirDjMNxOSvNjuVMmMU1fLrP1KDuq5zO9rfNFZohU6wgT7zXg9fB4+1fFWrYqtegorMHTTEbw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 05ea9cf5-e195-11ee-b972-005056bdfda7; Thu, 14 Mar 2024 01:54:26 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 02/11] pinctrl: aw9523: Use correct error code for not supported functionality Date: Thu, 14 Mar 2024 01:52:05 +0200 Message-ID: <20240313235422.180075-3-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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 pin control subsystem internally uses ENOTSUPP for the not supported functionality. The checkpatch is false positive about this error code. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 66629af0b88b4..65d523697b731 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -6,6 +6,7 @@ */ =20 #include +#include #include #include #include @@ -239,7 +240,7 @@ static int aw9523_pcfg_param_to_reg(enum pin_config_par= am pcp, int pin, u8 *r) reg =3D AW9523_REG_OUT_STATE(pin); break; default: - return -EOPNOTSUPP; + return -ENOTSUPP; } *r =3D reg; =20 @@ -290,7 +291,7 @@ static int aw9523_pconf_get(struct pinctrl_dev *pctldev= , unsigned int pin, val =3D FIELD_GET(AW9523_GCR_GPOMD_MASK, val); break; default: - return -EOPNOTSUPP; + return -ENOTSUPP; } if (val < 1) return -EINVAL; @@ -344,7 +345,7 @@ static int aw9523_pconf_set(struct pinctrl_dev *pctldev= , unsigned int pin, case PIN_CONFIG_DRIVE_OPEN_DRAIN: /* Open-Drain is supported only on port 0 */ if (pin >=3D AW9523_PINS_PER_PORT) { - rc =3D -EOPNOTSUPP; + rc =3D -ENOTSUPP; goto end; } mask =3D AW9523_GCR_GPOMD_MASK; @@ -361,7 +362,7 @@ static int aw9523_pconf_set(struct pinctrl_dev *pctldev= , unsigned int pin, val =3D AW9523_GCR_GPOMD_MASK; break; default: - rc =3D -EOPNOTSUPP; + rc =3D -ENOTSUPP; goto end; } =20 --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (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 E76B55D8E4 for ; Wed, 13 Mar 2024 23:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374139; cv=none; b=o+THMhSSShI79D2xtycKQv6/DzWCRllyh3NSJ54ZiIA55+Q5UFgMZPo+jxRNhCzNkFWpHeLWq982pspxEZAvgQUnt8RwW3698fHiYCeT3dm9uWLWbp7N5EcyZxYucDbc5a4UHeFiOpK8trDn/l0/NGen4hzn1lnNUbnjcIFMvIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374139; c=relaxed/simple; bh=k+1YhdyA6bA8FnqCXxwU7KWqjxoU2scZqrkAAb7HRG4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VjyacF/HbXj7Qc55DQ8GzprVCAp+qFbKWcwzMzeaEXoYUav2dWKd+KKJ/mUgR2L44JZ5zkl9fIw70f3e62POtESRZxg1C2jkMklTR4L/bnuBa0WCV8f7vtw4yYXJcMyEPb0Q0lwMtpqlGQSr/436EEPw9CYN83qkS1/M21jRtLU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 06688e94-e195-11ee-abf4-005056bdd08f; Thu, 14 Mar 2024 01:54:27 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 03/11] pinctrl: aw9523: Always try both ports in aw9523_gpio_set_multiple() Date: Thu, 14 Mar 2024 01:52:06 +0200 Message-ID: <20240313235422.180075-4-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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 ports are equivalent from the user's point of view. Don't limit trying them both if writing to one fails. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 65d523697b731..d93640a02d1d3 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -653,7 +653,7 @@ static void aw9523_gpio_set_multiple(struct gpio_chip *= chip, struct aw9523 *awi =3D gpiochip_get_data(chip); u8 mask_lo, mask_hi, bits_lo, bits_hi; unsigned int reg; - int ret =3D 0; + int ret; =20 mask_lo =3D *mask & U8_MAX; mask_hi =3D (*mask >> 8) & U8_MAX; @@ -663,10 +663,8 @@ static void aw9523_gpio_set_multiple(struct gpio_chip = *chip, bits_hi =3D (*bits >> 8) & U8_MAX; =20 ret =3D regmap_write_bits(awi->regmap, reg, mask_hi, bits_hi); - if (ret) { + if (ret) dev_warn(awi->dev, "Cannot write port1 out level\n"); - goto out; - } } if (mask_lo) { reg =3D AW9523_REG_OUT_STATE(0); @@ -675,7 +673,6 @@ static void aw9523_gpio_set_multiple(struct gpio_chip *= chip, if (ret) dev_warn(awi->dev, "Cannot write port0 out level\n"); } -out: mutex_unlock(&awi->i2c_lock); } =20 --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (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 AAD641E480 for ; Wed, 13 Mar 2024 23:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374139; cv=none; b=UeGiElnJqRYj6zo1LzfI/MQ8DzE3uw28IOLsgDP4Vp0oEjEkhyNn+GXhxIjS9hBZ+xJPjfx7Ngxe0vWW9GlJTjNIx9FjKSWUSOcMOL+wLWEJpsNVzFSUxfyznlRfDMeqnCJZaw5UO0V6eaJVCiU7gwYZlfDsmu0+URBdO2uV4RA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374139; c=relaxed/simple; bh=8D7jTV0xn/0mDBGlZq6fj5SKZW5PkOCJZRDVQD3dKCs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K2jwMns45fD82YdLY1QDBWP5siZdsgTFH3OCRUXAqBCysYEQbVvjoOr49/jEZwonjmFYP0+LyYEIXRH9umIt/KT8C4v60wAg9F0NjXw1z9wBZRHpCZ9xrki0s+xfYEpvPjJe6ZLz34h+djEPfoF4WMDqrLGf59qLLstmVWzTTJo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 06ec8550-e195-11ee-b972-005056bdfda7; Thu, 14 Mar 2024 01:54:27 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 04/11] pinctrl: aw9523: Make use of struct pinfunction and PINCTRL_PINFUNCTION() Date: Thu, 14 Mar 2024 01:52:07 +0200 Message-ID: <20240313235422.180075-5-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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" From: Andy Shevchenko Since pin control provides a generic data type and a macro for the pin function definition, use them in the driver. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index d93640a02d1d3..79916e6bf6f4e 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -66,18 +66,6 @@ struct aw9523_irq { u16 cached_gpio; }; =20 -/* - * struct aw9523_pinmux - Pin mux params - * @name: Name of the mux - * @grps: Groups of the mux - * @num_grps: Number of groups (sizeof array grps) - */ -struct aw9523_pinmux { - const char *name; - const char * const *grps; - const u8 num_grps; -}; - /* * struct aw9523 - Main driver structure * @dev: device handle @@ -158,17 +146,9 @@ static const char * const gpio_pwm_groups[] =3D { }; =20 /* Warning: Do NOT reorder this array */ -static const struct aw9523_pinmux aw9523_pmx[] =3D { - { - .name =3D "pwm", - .grps =3D gpio_pwm_groups, - .num_grps =3D ARRAY_SIZE(gpio_pwm_groups), - }, - { - .name =3D "gpio", - .grps =3D gpio_pwm_groups, - .num_grps =3D ARRAY_SIZE(gpio_pwm_groups), - }, +static const struct pinfunction aw9523_pmx[] =3D { + PINCTRL_PINFUNCTION("pwm", gpio_pwm_groups, ARRAY_SIZE(gpio_pwm_groups)), + PINCTRL_PINFUNCTION("gpio", gpio_pwm_groups, ARRAY_SIZE(gpio_pwm_groups)), }; =20 static int aw9523_pmx_get_funcs_count(struct pinctrl_dev *pctl) @@ -184,10 +164,10 @@ static const char *aw9523_pmx_get_fname(struct pinctr= l_dev *pctl, =20 static int aw9523_pmx_get_groups(struct pinctrl_dev *pctl, unsigned int se= l, const char * const **groups, - unsigned int * const num_groups) + unsigned int * const ngroups) { - *groups =3D aw9523_pmx[sel].grps; - *num_groups =3D aw9523_pmx[sel].num_grps; + *groups =3D aw9523_pmx[sel].groups; + *ngroups =3D aw9523_pmx[sel].ngrpoups; return 0; } =20 --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (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 475135D8F6 for ; Wed, 13 Mar 2024 23:55:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374140; cv=none; b=AxbLfND+wSoOKLZf3PR8b05sn/yUOB5Da5B4yrj4EKJSPdU/WMDu1uCwg5oUXf3BDpeT2TFB1dn3HaL0vrhcWms7ivZXx58cdcqtAXeYFf+yOeaTdOu1NRj7gXM6M1u4GeEwSYWczEYIOufMOXh+9odeRA+snODKUFUitwwCH5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374140; c=relaxed/simple; bh=/2xiYsQiRb+aViv4WHP41Tr0LGskzf2GigCrhrMxVnw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HhG8CsP3YWddgefF6V9AHwGr+kCa5olrQAliuKP8drIWpSL05EUCN5iz8RTi7lmqgkR6XPtDLe9KpqIaKvDvrAsGoDAuOJPT0nYgFYdyPkJ2w4k2M5ceZjAHE5KujVLE9//2H4iqYOWEcW1EvA8oe5XJwqYsXQpME8RpAuMV1w0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 076695d5-e195-11ee-abf4-005056bdd08f; Thu, 14 Mar 2024 01:54:28 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 05/11] pinctrl: aw9523: Use temporary variable for HW IRQ number Date: Thu, 14 Mar 2024 01:52:08 +0200 Message-ID: <20240313235422.180075-6-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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" There are two different ways on how to get HW IRQ number in some functions. Unify that by using temporary variable and irqd_to_hwirq() call. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 79916e6bf6f4e..118896373844a 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -428,12 +428,12 @@ static int aw9523_gpio_irq_type(struct irq_data *d, u= nsigned int type) static void aw9523_irq_mask(struct irq_data *d) { struct aw9523 *awi =3D gpiochip_get_data(irq_data_get_irq_chip_data(d)); - unsigned int n =3D d->hwirq % AW9523_PINS_PER_PORT; + irq_hw_number_t hwirq =3D irqd_to_hwirq(d); + unsigned int n =3D hwirq % AW9523_PINS_PER_PORT; =20 - regmap_update_bits(awi->regmap, - AW9523_REG_INTR_DIS(d->hwirq), + regmap_update_bits(awi->regmap, AW9523_REG_INTR_DIS(hwirq), BIT(n), BIT(n)); - gpiochip_disable_irq(&awi->gpio, irqd_to_hwirq(d)); + gpiochip_disable_irq(&awi->gpio, hwirq); } =20 /* @@ -446,11 +446,11 @@ static void aw9523_irq_mask(struct irq_data *d) static void aw9523_irq_unmask(struct irq_data *d) { struct aw9523 *awi =3D gpiochip_get_data(irq_data_get_irq_chip_data(d)); - unsigned int n =3D d->hwirq % AW9523_PINS_PER_PORT; + irq_hw_number_t hwirq =3D irqd_to_hwirq(d); + unsigned int n =3D hwirq % AW9523_PINS_PER_PORT; =20 - gpiochip_enable_irq(&awi->gpio, irqd_to_hwirq(d)); - regmap_update_bits(awi->regmap, - AW9523_REG_INTR_DIS(d->hwirq), + gpiochip_enable_irq(&awi->gpio, hwirq); + regmap_update_bits(awi->regmap, AW9523_REG_INTR_DIS(hwirq), BIT(n), 0); } =20 --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (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 46AB65D908 for ; Wed, 13 Mar 2024 23:55:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374140; cv=none; b=DB/UG/fPlOZnE2GN+cUhXUinR62ThAMoSr5gsMq8AAa9V+Cn1jJPk2PP0Lunw9Y+pqwnJ7c9j30J+jHITy37hStBqrLzqi94k+Zq+BP9I7Cz24vxj9/wdRczD72ScLbfb12+rbeACuNW4k08jU9Kil6mqc4nEuTKQIMks9NrnOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374140; c=relaxed/simple; bh=A/6Rxz4Bmsq8vL9J8RxsvzpoTJK2t8DPLAAu7jQ7ezk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XDLQ8tm1fbzunp1Hnrdok9rh6LxwJ4zIZFiEbunhH3GGmkhTmvmXqa3OUvtb7Zs7p7qFtm3HtxJE76+KvddAf0CTKOkYyGquXlR6gvNIYaMjrEwjMOsEdPh1ddDPELKlDCR3etylc4ke9jEml0IcxT3iF8Wxfz4slvFL5uOiN9w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 07bc019b-e195-11ee-b972-005056bdfda7; Thu, 14 Mar 2024 01:54:29 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 06/11] pinctrl: aw9523: Get rid of redundant ' & U8_MAX' pieces Date: Thu, 14 Mar 2024 01:52:09 +0200 Message-ID: <20240313235422.180075-7-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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" When the variable is declared as u8, no need to perform ' & U8_MAX' as it's implied anyway. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 118896373844a..9e8e658f81404 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -603,7 +603,7 @@ static int aw9523_gpio_get_multiple(struct gpio_chip *c= hip, mutex_lock(&awi->i2c_lock); =20 /* Port 0 (gpio 0-7) */ - m =3D *mask & U8_MAX; + m =3D *mask; if (m) { ret =3D _aw9523_gpio_get_multiple(awi, 0, &state, m); if (ret) @@ -612,7 +612,7 @@ static int aw9523_gpio_get_multiple(struct gpio_chip *c= hip, *bits =3D state; =20 /* Port 1 (gpio 8-15) */ - m =3D (*mask >> 8) & U8_MAX; + m =3D *mask >> 8; if (m) { ret =3D _aw9523_gpio_get_multiple(awi, AW9523_PINS_PER_PORT, &state, m); @@ -635,20 +635,20 @@ static void aw9523_gpio_set_multiple(struct gpio_chip= *chip, unsigned int reg; int ret; =20 - mask_lo =3D *mask & U8_MAX; - mask_hi =3D (*mask >> 8) & U8_MAX; + mask_lo =3D *mask; + mask_hi =3D *mask >> 8; + bits_lo =3D *bits; + bits_hi =3D *bits >> 8; + mutex_lock(&awi->i2c_lock); if (mask_hi) { reg =3D AW9523_REG_OUT_STATE(AW9523_PINS_PER_PORT); - bits_hi =3D (*bits >> 8) & U8_MAX; - ret =3D regmap_write_bits(awi->regmap, reg, mask_hi, bits_hi); if (ret) dev_warn(awi->dev, "Cannot write port1 out level\n"); } if (mask_lo) { reg =3D AW9523_REG_OUT_STATE(0); - bits_lo =3D *bits & U8_MAX; ret =3D regmap_write_bits(awi->regmap, reg, mask_lo, bits_lo); if (ret) dev_warn(awi->dev, "Cannot write port0 out level\n"); --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) (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 CCF7B5D73B for ; Wed, 13 Mar 2024 23:54:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374076; cv=none; b=pVO0LNHBo8jH2tqxNSS0vgSyZ9ka8BzFNaNehrlTLNCz1ouXIdz8cVWz3TddJbN08VHkEOC/Cn6nE82sknO1R3r8RLI4fxmgIvF168lFChCzfAox6DgqzXcZS3egwNqq+ZAWJOx2dIDBPL5U1Dn87ymMaoYQ2sZBfW1yezkDJ5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374076; c=relaxed/simple; bh=uEE6BWybd871+/CXBV9iWvsh4Tn0g6Ge38RppUuETfY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZpBrhAu3XgRVzE/v0lvi1R/EXaGMA8eiFPm8LRZWSrv5TrpTtVQy53JxsN+8cmkGQBk/jmMdd7rL7V58vGSIerDObtwf6b/mUJ2MOG9JksZulgO3Q7CzVmRqP/tYiktGFkvA8xuY6HYHwNRcNLcw7QvptjN3ak+Ei70RElHuIB8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 0883fa43-e195-11ee-b3cf-005056bd6ce9; Thu, 14 Mar 2024 01:54:30 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 07/11] pinctrl: aw9523: Remove unused irqchip field in struct aw9523_irq Date: Thu, 14 Mar 2024 01:52:10 +0200 Message-ID: <20240313235422.180075-8-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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 irqchip field is allocated, assigned but never used. Remove it. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 9e8e658f81404..44b798c39e26b 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -57,12 +57,10 @@ /* * struct aw9523_irq - Interrupt controller structure * @lock: mutex locking for the irq bus - * @irqchip: structure holding irqchip params * @cached_gpio: stores the previous gpio status for bit comparison */ struct aw9523_irq { struct mutex lock; - struct irq_chip *irqchip; u16 cached_gpio; }; =20 @@ -805,21 +803,15 @@ static int aw9523_init_irq(struct aw9523 *awi, int ir= q) { struct device *dev =3D awi->dev; struct gpio_irq_chip *girq; - struct irq_chip *irqchip; int ret; =20 if (!device_property_read_bool(dev, "interrupt-controller")) return 0; =20 - irqchip =3D devm_kzalloc(dev, sizeof(*irqchip), GFP_KERNEL); - if (!irqchip) - return -ENOMEM; - awi->irq =3D devm_kzalloc(dev, sizeof(*awi->irq), GFP_KERNEL); if (!awi->irq) return -ENOMEM; =20 - awi->irq->irqchip =3D irqchip; mutex_init(&awi->irq->lock); =20 ret =3D devm_request_threaded_irq(dev, irq, NULL, aw9523_irq_thread_func, --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (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 5D2865D907 for ; Wed, 13 Mar 2024 23:54:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374078; cv=none; b=jRnzdEX/hc9A2NBgeAsruV2Kn5p9rC37EHdxFGrv09eqA1iDAfg5WAjRC2I4MrfWmrUv9zIfWCD/7j3EOQXq+XA9XA/nciJknRFEptaUpJ0HGzmBFXypIRJExqFqXF2wh8UDWJNv5IzLUqyJacwcmZrfFNqISkExvS9TXeutQqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374078; c=relaxed/simple; bh=GLJSgRLelWjt7dIinJmYtT1PfasRJUH2zmyz15NzJ20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YlVozuSBFH/DpzsZp0YazWRbqBHJCxLGynURKzHp3+h27bYP/AxvjeC0xo1u4FY8Cj9stupEU2fuDlRXGbjFsiPJc0ZYGM89jGwUbG+Xi4C+57vT0ZcjmsTWrdpQ1n8cDsi5RfMIp1dRbypmz4o4bXytnV7vzynD/szt6GYEOfg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id 096ee361-e195-11ee-a9de-005056bdf889; Thu, 14 Mar 2024 01:54:32 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 08/11] pinctrl: aw9523: Make use of dev_err_probe() Date: Thu, 14 Mar 2024 01:52:11 +0200 Message-ID: <20240313235422.180075-9-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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" From: Andy Shevchenko Simplify the error handling in probe function by switching from dev_err() to dev_err_probe(). Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 44b798c39e26b..17c359f9c45c0 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -816,10 +816,8 @@ static int aw9523_init_irq(struct aw9523 *awi, int irq) =20 ret =3D devm_request_threaded_irq(dev, irq, NULL, aw9523_irq_thread_func, IRQF_ONESHOT, dev_name(dev), awi); - if (ret) { - dev_err(dev, "Failed to request irq %d\n", irq); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to request irq %d\n", irq); =20 girq =3D &awi->gpio.irq; gpio_irq_chip_set_chip(girq, &aw9523_irq_chip); @@ -1016,8 +1014,7 @@ static int aw9523_probe(struct i2c_client *client) =20 awi->pctl =3D devm_pinctrl_register(dev, pdesc, awi); if (IS_ERR(awi->pctl)) { - ret =3D PTR_ERR(awi->pctl); - dev_err(dev, "Cannot register pinctrl: %d", ret); + ret =3D dev_err_probe(dev, PTR_ERR(awi->pctl), "Cannot register pinctrl"= ); goto err_disable_vregs; } =20 --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (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 18A185EE7F for ; Wed, 13 Mar 2024 23:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374078; cv=none; b=Rtsz91A2Xwuux32GAODRmaC5G7zp55a6N+QXOcBN0QPWe1HRzoWFn+6vb2IIFP78kTtebuI9+TZssOYSbRAaiK0y+8FWKQShr67OsYa1LHTX34x6J8ub7sqgJIVTUK2/cKsDRPI2vyiI9GOj7rRaCkgkUyfOywyLDYWlS54bVqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374078; c=relaxed/simple; bh=EZ78oLcHeMZki7oJrS99GWqnNnBIlAKS0pn12DtquGU=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GzqQRayjWaWMTWFBdEBjANUXV50ny7jv7q0z+2O6GJ5B9jJojvOflCvLOQCmENtvd2SIeUj4gFpjPV13hzViCHHL3yS9QzPsGnBGvp52Ze0VcSN4s5uSiTOJTGeyXz7nOL4qHGnZQRQ1Idjpg/Fp68KVqwe4NkxJiDBdbED+zE4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 0a584e33-e195-11ee-b972-005056bdfda7; Thu, 14 Mar 2024 01:54:33 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 09/11] pinctrl: aw9523: Sort headers and group pinctrl/* Date: Thu, 14 Mar 2024 01:52:12 +0200 Message-ID: <20240313235422.180075-10-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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" One header was misplaced and group pinctrl/* ones to show the relation with the pin control subsystem. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 17c359f9c45c0..50e2a94f59892 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -13,17 +13,18 @@ #include #include #include -#include #include -#include -#include -#include -#include +#include #include #include #include #include =20 +#include +#include +#include +#include + #define AW9523_MAX_FUNCS 2 #define AW9523_NUM_PORTS 2 #define AW9523_PINS_PER_PORT 8 --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (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 86BA65F546 for ; Wed, 13 Mar 2024 23:54:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374080; cv=none; b=la9NksIeAIfGt2A04lo6x3fKK0AvD3fjS2Yiaer2z5Mli6Z6EsfKtYEjv0xI8qE5KbL6jWz3Ve3abzh1nQfG/NuIryy9QcWL1gbjJENb6jSbn4f1EmnFoasBZpwimqC+F6oe6DHVKC6H31Y9kDuk8qdwfnh3SBKJhfSc8Mf1J34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374080; c=relaxed/simple; bh=zeBdlgwqgx5wxRWTKXs76tXPrMlAR3YEbWfVlts1pHk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HXFQyoM49LUy7p18O1amzQcSyuD5NdBhQAuouHgxgebBZRzgrXy3E4q7T1mhHH1b/x1Wd8AgYThtan8nBwDg/g7yVmjj+ha6margcsnOMZ/es06gUv0YSIGY+P3yuEfCF3NRMiL1KgBnQlyaEDXltUaGVoEha4edj8GBXvUDXt0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 0b3b6ec2-e195-11ee-abf4-005056bdd08f; Thu, 14 Mar 2024 01:54:35 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 10/11] pinctrl: aw9523: Fix indentation in a few places Date: Thu, 14 Mar 2024 01:52:13 +0200 Message-ID: <20240313235422.180075-11-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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" In the comment, function prototype, and array of strings indentation is kinda broken. Reindent that. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/pinctrl-aw9523.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 50e2a94f59892..7299b5bb6d52f 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -1,8 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Awinic AW9523B i2c pin controller driver - * Copyright (c) 2020, AngeloGioacchino Del Regno - * + * Copyright (c) 2020, AngeloGioacchino Del Regno */ =20 #include @@ -139,9 +138,10 @@ static const struct pinctrl_ops aw9523_pinctrl_ops =3D= { }; =20 static const char * const gpio_pwm_groups[] =3D { - "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", - "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", - "gpio12", "gpio13", "gpio14", "gpio15" + "gpio0", "gpio1", "gpio2", "gpio3", /* 0-3 */ + "gpio4", "gpio5", "gpio6", "gpio7", /* 4-7 */ + "gpio8", "gpio9", "gpio10", "gpio11", /* 8-11 */ + "gpio12", "gpio13", "gpio14", "gpio15", /* 11-15 */ }; =20 /* Warning: Do NOT reorder this array */ @@ -388,8 +388,8 @@ static int aw9523_get_pin_direction(struct regmap *regm= ap, u8 pin, u8 n) * * Return: Zero for success or negative number for error */ -static int aw9523_get_port_state(struct regmap *regmap, u8 pin, - u8 regbit, unsigned int *state) +static int aw9523_get_port_state(struct regmap *regmap, u8 pin, u8 regbit, + unsigned int *state) { u8 reg; int dir; @@ -984,8 +984,7 @@ static int aw9523_probe(struct i2c_client *client) } =20 mutex_init(&awi->i2c_lock); - lockdep_set_subclass(&awi->i2c_lock, - i2c_adapter_depth(client->adapter)); + lockdep_set_subclass(&awi->i2c_lock, i2c_adapter_depth(client->adapter)); =20 pdesc =3D devm_kzalloc(dev, sizeof(*pdesc), GFP_KERNEL); if (!pdesc) --=20 2.44.0 From nobody Mon Feb 9 03:45:44 2026 Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (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 1BE6A5FBAE for ; Wed, 13 Mar 2024 23:54:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374080; cv=none; b=DgftPhGgoV2UNAAOa3ue4zTYZilKOYqzt/zwO5vC0zdElERZffSdJ1XbrDGcFKGohqU4paWIoSJtcr4C/TM589o163xJUfejrte/foGshuSxNRwqThvOPAFBmyZ5l/8UPxOb336i0zN4ZUE6zEw7/t6ATFrlgQI9LOvL2uYivNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374080; c=relaxed/simple; bh=fo5pTpAUaSEiV9SCl+Yms4vQWIJjKj9xKfNuTuMVb7E=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DI+PmO0n2q+1ZDVFchubrJR5Zk+Mv1JdB1LfTxszEXkDqHml/kxaD3egvzp9zSDdTz072v6h1g1ZG154TAwAsByfZSf+Hbx3qGV9oZEFysOjo2/H7qsw9xGFPwEsXAsLLRe6lusRbs0pOCYiL91Bd/ZDIxpd+FZAZfpbH95l3XY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id 0c28349c-e195-11ee-a9de-005056bdf889; Thu, 14 Mar 2024 01:54:36 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 11/11] pinctrl: aw9523: Remove redundant dependency to OF Date: Thu, 14 Mar 2024 01:52:14 +0200 Message-ID: <20240313235422.180075-12-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@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" Driver does not dependent on OF, remove it. While here, add missing mod_devicetable.h. Signed-off-by: Andy Shevchenko Reviewed-by: Dan Carpenter --- drivers/pinctrl/Kconfig | 2 +- drivers/pinctrl/pinctrl-aw9523.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index d45657aa986ae..c413109b1173b 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -129,7 +129,7 @@ config PINCTRL_AXP209 =20 config PINCTRL_AW9523 tristate "Awinic AW9523/AW9523B I2C GPIO expander pinctrl driver" - depends on OF && I2C + depends on I2C select PINMUX select PINCONF select GENERIC_PINCONF diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9= 523.c index 7299b5bb6d52f..43285e6d0e5b7 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include --=20 2.44.0