From nobody Mon Feb 9 23:44:57 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 9205D69E0D for ; Fri, 29 Mar 2024 10:57:48 +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=1711709870; cv=none; b=DUr6fcvhqt2qDwIkgM4HFiJmi2xPfv96hcg6qRO6XWAH+94oytXM86T5AYBu756cZb4YygNx3dE56v9qDYG2k88Bhj1R/uOWSbPqTxWP0ni5qYG+DBCb5nABkjC6PO+hJ4mOLVvtmDykFyzG+BThuGesfWWhQqMFB+vVlzVGtPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709870; c=relaxed/simple; bh=4haKc0BWmXZv48XAJVDKU0krU0tVfIaoXXWWf/W8YnQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T/XXIHKXmPHphBkZ3PreHulCy5SVVprKBQ2VyJ8WrqArS7oIiOiW2zAj1fmYfYMhKEvYhwCzIDZ6rQ7SXFPB69uE6Ag2svzrNvIy/P3M60r0PZF+ZGgdO/aMqayvbu7I1rFephm3tigm2wR4lYeRi0qjXATkXtigjlm4Al9z1PA= 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 04261c89-edbb-11ee-b3cf-005056bd6ce9; Fri, 29 Mar 2024 12:56:38 +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 v2 01/11] pinctrl: aw9523: Destroy mutex on ->remove() Date: Fri, 29 Mar 2024 12:55:15 +0200 Message-ID: <20240329105634.712457-2-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 23:44:57 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 0153869E0F for ; Fri, 29 Mar 2024 10:57:48 +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=1711709870; cv=none; b=AjNnknpte/zR0SSuQBJGfCaYTNA8zGvH5lXYYaP+EhuVVor+zp18JiM5qMOuzw+pIWMtmLxaTQjgE9GPkusqEcIbydF5fDO5kOvKgVa4mz8LfPBBd3jiu452JL/60OgMQH0upErZllHL7wcWyF5nYC+XbeIo5DLMGLTVw0aP2oM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709870; c=relaxed/simple; bh=nSF/R8gYLxY6alFA60B5rOXw4QyV2pEDvssncoOLngY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gmMspT7KmfHPezgIKSXvcRfoE5ynAez8J0QcBZTrth1JcXgGJeIiPLAPiTmJ1qZys3SVhK/6plilOVivT2LoZHqL19P0Xl8ULL2nyUUc9nT+6MKG5qKZyHUOP7fiT25XfvQhDmD6BBu/kukASP+rOurSXG6Nr7c9SM9q9+HQxOE= 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 04a93f69-edbb-11ee-b3cf-005056bd6ce9; Fri, 29 Mar 2024 12:56:38 +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 v2 02/11] pinctrl: aw9523: Use correct error code for not supported functionality Date: Fri, 29 Mar 2024 12:55:16 +0200 Message-ID: <20240329105634.712457-3-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 23:44:57 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 760476A8CF for ; Fri, 29 Mar 2024 10:56:47 +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=1711709809; cv=none; b=D+NHwr3OinLWGPXr98b58xFKoLyq4cllW6gdJTyojKEypfvNSxFSLhWrFU0a2WEJtbV9Zcv+5yyJNhPHTg1jn9vR9ZVVrrknD8ZWpFdvSA2TxxzjaCtlqAjIWgwaMe+DvKTfIYHYV0l9bqeBHZeKPcjRS/gKmpxBzhp+FEDg/qY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709809; c=relaxed/simple; bh=k+1YhdyA6bA8FnqCXxwU7KWqjxoU2scZqrkAAb7HRG4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eupVIsdUFvPlpYlue511o5Zjx05X8jsZeDLGvOIfY2VXIWIxlJaOpJcGecWiwlPJaMwHbUhlKJAW+QYeKoHV88elmghooQa6FhFyZ4JW9bXjM4D4dPSSAwbLJ1WpEwfTVkdhYp7xwikCsHyTEG5WHjli01JK1UPS2BNWJ/yl1HA= 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 04ffcd06-edbb-11ee-b972-005056bdfda7; Fri, 29 Mar 2024 12:56:39 +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 v2 03/11] pinctrl: aw9523: Always try both ports in aw9523_gpio_set_multiple() Date: Fri, 29 Mar 2024 12:55:17 +0200 Message-ID: <20240329105634.712457-4-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 23:44:57 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 84A037D416 for ; Fri, 29 Mar 2024 10:56:49 +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=1711709811; cv=none; b=XOvOGxVQjI6xm7vGMw1y0PZb27c2adA8Yce1qbBpQQbCE0nj9CD2FlUtzs+rppi++Q6tGuQJ6ZsX6Y1zR5OgKDI5SYoP3KyS3gxN+EF+wMUTb+rETVbxVspSqpOSQ/lVPMkYtPR3lxdj3apbAW5PN+D7EjZuYWppdhSwW4QVy2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709811; c=relaxed/simple; bh=76IT1a2GUz6XBzbVi4WyO5trFZFO8WMfWnONPgI9AQY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=huF7rJl4SWtusmPNUbPkChJP62TWZl3nSL0Mh+SSOxS9CAXwA26wCDQjbF5nLQSE6YAiCq3QH6crWw8/i00tp1SQr1fGXoIVfv7NX7Mubqmx/S9EvKsAlDSiGnvTXf88u28uRt8GUjvkItAvGh6WptMWuDTNqJbHTPId7b4M8t0= 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 fgw22.mail.saunalahti.fi (Halon) with ESMTP id 058b1d91-edbb-11ee-a9de-005056bdf889; Fri, 29 Mar 2024 12:56:41 +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 v2 04/11] pinctrl: aw9523: Make use of struct pinfunction and PINCTRL_PINFUNCTION() Date: Fri, 29 Mar 2024 12:55:18 +0200 Message-ID: <20240329105634.712457-5-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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..7db901216a94c 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].ngroups; return 0; } =20 --=20 2.44.0 From nobody Mon Feb 9 23:44:57 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 4DCD36A355 for ; Fri, 29 Mar 2024 10:57:51 +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=1711709873; cv=none; b=jBlmdlTWJgtFenK+gyglxAPN88oo8veRNaag3+JYs6qyS6vDsCIgmVDvWW+Sklt2TdexJ7EL4TnhT/zNrEGpXeZslUgwV0woQvjzfvDx2WeUCe8FG8lKjBzIxOzGQuV1KrlJDhD/UtdnKPUS3xmX9kG8VmO+D8xNOQyJpBRp0oE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709873; c=relaxed/simple; bh=GI3pmjFDTQrAB0t+CrsgeVXfRQwlTIx8MloFcQOk+1Q=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hXHZmxOH1hqaXafhFUKHJqOhmkjUNCZp2mNj3aEOYB71fzDm+WuxaORFDXVKm93olMB394W+hiZ/jOIoVZz9B4DffremW3JAQ1+uZT0UDj5yN7pH4EPL+sSXfYwNU/9DR2b9rodTGOWsDoUY6zM7fe37ibVlKC7lMjl2APN8vBA= 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 0663c7c8-edbb-11ee-b3cf-005056bd6ce9; Fri, 29 Mar 2024 12:56:41 +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 v2 05/11] pinctrl: aw9523: Use temporary variable for HW IRQ number Date: Fri, 29 Mar 2024 12:55:19 +0200 Message-ID: <20240329105634.712457-6-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 7db901216a94c..0f3361fa9ed88 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 23:44:57 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 6DF926A8CA for ; Fri, 29 Mar 2024 10:56:50 +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=1711709812; cv=none; b=gafVGeUjH/TIBWyFwZZi2KYj6lSplE/UeCePu5sumVmm23J6g/cUtreQmxIILCcbtO/G+NwgvLgV2u1gVp3UXtOGWiXnMaESqoHMA7BxyW4ItZvg1JmMZzajhvKDW/f/Wmb2ok942yiTV+r4ciqjOcgj/YaFZ0veUPWCLW+Dl6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709812; c=relaxed/simple; bh=f4f/kh0PmFJ42uACJgiRQ6RY/91nQkYiihrMsW88gGg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lkUF5qkeIpiiLojuZ1siSXn9i3YC5NzxcXjC2ctEJ5chR1ZuxdaWShVSUKhOMzSTAEGvwS977JHZKfuy+SOJm/XhfWrYbi9XDi0mAQMPAiZwlw8G8KxCfk28bS9nhA3epoOp5wyQPHU3HCFMyJUD7hHpYify53885LoIg6cN3FQ= 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 06bb802c-edbb-11ee-a9de-005056bdf889; Fri, 29 Mar 2024 12:56:42 +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 v2 06/11] pinctrl: aw9523: Get rid of redundant ' & U8_MAX' pieces Date: Fri, 29 Mar 2024 12:55:20 +0200 Message-ID: <20240329105634.712457-7-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 0f3361fa9ed88..8c615adb3d578 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 23:44:57 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 67E646A34B for ; Fri, 29 Mar 2024 10:56:45 +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=1711709807; cv=none; b=P58x0qhuY646G3nbuQWaHcr10YwjuAnlhQ7c0Maw615xhDYeG7OgRuKVkuP+fRXnmWiugb40OULGwzkldxS4JoyHRvcNf9cmKrsJPzJni2dp6VftY/TPJcOVP3V1BDHi+K5KBntOQ2DLAxrf3sIzcUlFu4JdQmauxh77XSffvMs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709807; c=relaxed/simple; bh=hR5SmMZRHVc6b1GDrG4uIwUL6+3ig4QW9kTK++2jt+8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qhNVRWmF/soCr7Xo0QmHQZGdbpq5KYEsV0lUEGsXC03sNV87S8NdDkvaegcdikR7GGfFskieNKABkFlq/ytQVNc46ZlGsGNb08IzRJ/KzV/qIYKiiJU/S2ulHk4tkmpGU+/WnsRGB0IDfCAlOwdQZJbhZw8jJjXhfmxEI2f0/CM= 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 07199218-edbb-11ee-abf4-005056bdd08f; Fri, 29 Mar 2024 12:56:43 +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 v2 07/11] pinctrl: aw9523: Remove unused irqchip field in struct aw9523_irq Date: Fri, 29 Mar 2024 12:55:21 +0200 Message-ID: <20240329105634.712457-8-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 8c615adb3d578..f084dad5c88f9 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 23:44:57 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 DDC807BB0D for ; Fri, 29 Mar 2024 10:56:48 +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=1711709810; cv=none; b=h47ycFb53JCGm/ednXaPw81vZ6F/+bi4o5ItdidHEBkqgopziBZ/2HSc7vvwHEj6LIU37nFOhmjabG2m5N07rem8wnRuuvLpfh9jsan4JdnDL/I5MR0vqrr45fm1yEoF6qHilyiLVX5q403nijuPOvSIWSiFHnBgGUJQblNyFoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709810; c=relaxed/simple; bh=GrV47NT5vn8t81Ahr/eNUVMeiZ6ilTSttqyQGbii5b0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SJy67qikKSmDhUnTV+nl2F42zx8hqVNx6Rv8ANC8ewRPnpDSo//wemZqJ/8aQaD2bvWfOxu0Ud9KutxZER1OMPTdmgDnak/Hj/s/YBsogpMmRFW6PiK7/sagYJhF863PIMVlbkadL4GvU073IwhtsnnBt2Ee9041V5LbtrmYaRU= 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 0791ead8-edbb-11ee-b3cf-005056bd6ce9; Fri, 29 Mar 2024 12:56:43 +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 v2 08/11] pinctrl: aw9523: Make use of dev_err_probe() Date: Fri, 29 Mar 2024 12:55:22 +0200 Message-ID: <20240329105634.712457-9-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 f084dad5c88f9..fe398c59c2d11 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 23:44:57 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 569AC83A1C for ; Fri, 29 Mar 2024 10:56:51 +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=1711709813; cv=none; b=p2w4eHhVz/TV9RIrwSPkkS/U5sb9RZkXVB3cy+WUhC5Rl/HXEUnQt2yzlEA40YMN/t5ebqMkTYtvAC1jKsligU41RAqKADytfeVJdMop3Rz1TNud2yPBZrhhYlIaSPVKN81tUNWRRkw62RoTHEPuHd7qCcE7WjkcSCmAHg/fLFQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709813; c=relaxed/simple; bh=MntR2VoWY9d1UM+GLc/rVG7Vv1KYkGV3SbVUjUoYChA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nEAEegulpRGIFdrDURGTPFNvoM3BsoD+n2bvevN6c8ulDdw6O5iaBX7uyFPucZuxoLcpwFYOWRuktyxFTTGcw0pPD4QMR5IZi1DQ7B5IODdssvNGkTLN59EME8XfCuj3dw2SWLOpsGMSJDiPRUk50vjwURYmXqL5yrfoy/jCB84= 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 080b5b1f-edbb-11ee-b3cf-005056bd6ce9; Fri, 29 Mar 2024 12:56:44 +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 v2 09/11] pinctrl: aw9523: Sort headers and group pinctrl/* Date: Fri, 29 Mar 2024 12:55:23 +0200 Message-ID: <20240329105634.712457-10-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 fe398c59c2d11..49d5035899227 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 23:44:57 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 75FD46A8C1 for ; Fri, 29 Mar 2024 10:56:47 +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=1711709809; cv=none; b=hm0Og2z54hb2YzjQkxi7WOdTVGG0XyiKji/DQbLrYw87yixv5VlKDxVawwBNLbcxxKiVsU0w20eMyM/C6EQUwOcGR2e3FReD7xPSzMlp/Of3s5fWQ2O4Yu3NPYW8INCpN0NSrNC0XpfX1Rttc00Z8E8zuk8XAbU2/yut3RrTal4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709809; c=relaxed/simple; bh=k82nFsDevwArKZdemO6rENI1k+BpJTfP0Xv1r08V0KM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qr/ixDPe5QLX9E/PE9EUPWcpA9Y+R1NRaLitIVBG43l2j4JVTJZ0XiQ8vjwWrzrO/cKG1/DQnKXC4svBqAh/03gSNNNxszmpQTn+19X6PphF4unBvk4/2WzztoxqLx13HE2FxHvsXom9sKCCUBWMKFRoUcuuHyz9HkfEcNaV5DU= 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 08621d3e-edbb-11ee-b972-005056bdfda7; Fri, 29 Mar 2024 12:56:45 +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 v2 10/11] pinctrl: aw9523: Fix indentation in a few places Date: Fri, 29 Mar 2024 12:55:24 +0200 Message-ID: <20240329105634.712457-11-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 49d5035899227..b5e1c467625ba 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 23:44:57 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 A3FBD85659 for ; Fri, 29 Mar 2024 10:56:52 +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=1711709814; cv=none; b=KtVBqFUkc6VPOGztUdBAQQrGO+3x6frZwSS4FxGUbd1lz8FMg9LgAr+ZNPvfqjYcDmd9ef3mBT3KnhllBX8rpP7xoh13JviyQhIlogU5kTbbDpPCpD31pliJlU9xuSoeOTZdmTzDSE+2JxUpk0zlMwNVhHvV2k9M3ppCApzWgQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709814; c=relaxed/simple; bh=Nu9sYchMYtdoAcYQDRWy92zX8RGluRxWCKF8EUIbUns=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LVjIffOhxXkUr3uDzFrqccHfhRxx1qoIgthRaTGerZ8uc702QMsF95ryjxy+M8jxFRNn5QaqaQ4xfCqU7FSX3S/b3bGBRTqXSh0ZMA7iBE2fd9wIzDuYmft9NwC7YjXU31DOHkFj0yXwX7qViOfd97hTAjREJi3xB2J9u4szpVc= 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 08e01b89-edbb-11ee-a9de-005056bdf889; Fri, 29 Mar 2024 12:56:46 +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 v2 11/11] pinctrl: aw9523: Remove redundant dependency to OF Date: Fri, 29 Mar 2024 12:55:25 +0200 Message-ID: <20240329105634.712457-12-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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 --- 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 b5e1c467625ba..1d0ce78115da7 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