linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Mark Brown <broonie@kernel.org>,
	William Breathitt Gray <william.gray@linaro.org>,
	Aidan MacDonald <aidanmacdonald.0x0@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: build failure after merge of the mfd tree
Date: Thu, 6 Apr 2023 08:36:46 +0100	[thread overview]
Message-ID: <20230406073646.GW8371@google.com> (raw)
In-Reply-To: <20230406120055.11fcfe5b@canb.auug.org.au>

On Thu, 06 Apr 2023, Stephen Rothwell wrote:

> Hi all,
>
> After merging the mfd tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
>
> drivers/mfd/qcom-pm8008.c:135:35: error: initialization of 'int (*)(unsigned int **, unsigned int,  const struct regmap_irq *, int,  void *)' from incompatible pointer type 'int (*)(unsigned int **, unsigned int,  const struct regmap_irq *, int)' [-Werror=incompatible-pointer-types]
>   135 |         .set_type_config        = pm8008_set_type_config,
>       |                                   ^~~~~~~~~~~~~~~~~~~~~~
> drivers/mfd/qcom-pm8008.c:135:35: note: (near initialization for 'pm8008_irq_chip.set_type_config')
>
> Caused by commit
>
>   72a8a08b0c62 ("mfd: qcom-pm8008: Convert irq chip to config regs")
>
> interacting with commit
>
>   7697c64b9e49 ("regmap: Pass irq_drv_data as a parameter for set_type_config()")
>
> from the regmap tree.
>
> I have applied the following merge fix patch:
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Thu, 6 Apr 2023 11:37:44 +1000
> Subject: [PATCH] fixup for "mfd: qcom-pm8008: Convert irq chip to config regs"
>
> interacting with "regmap: Pass irq_drv_data as a parameter for set_type_config()"
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/mfd/qcom-pm8008.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
> index a33fbc42ac8e..e60c838a78c1 100644
> --- a/drivers/mfd/qcom-pm8008.c
> +++ b/drivers/mfd/qcom-pm8008.c
> @@ -85,7 +85,8 @@ static unsigned int pm8008_get_irq_reg(struct regmap_irq_chip_data *data,
>  }
>
>  static int pm8008_set_type_config(unsigned int **buf, unsigned int type,
> -				  const struct regmap_irq *irq_data, int idx)
> +				  const struct regmap_irq *irq_data, int idx,
> +				  void *irq_drv_data)
>  {
>  	switch (type) {
>  	case IRQ_TYPE_EDGE_FALLING:

Applied, squashed and credit given, thanks:

Author: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Date:   Thu Feb 16 22:22:12 2023 +0000

    mfd: qcom-pm8008: Convert irq chip to config regs

    Replace type and virtual registers, which are both deprecated,
    with config registers. This also simplifies the driver because
    IRQ types are set in one place, the set_type_config() callback.

    Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
    [Lee: Squashed in fix-up patch from Stephen Rothwell adapting to new .set_type_config() API]
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: Lee Jones <lee@kernel.org>
    Link: https://lore.kernel.org/r/20230216222214.138671-3-aidanmacdonald.0x0@gmail.com
---
 drivers/mfd/qcom-pm8008.c | 51 ++++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
index 39fd2a792e736..d502ecf055903 100644
--- a/drivers/mfd/qcom-pm8008.c
+++ b/drivers/mfd/qcom-pm8008.c
@@ -66,15 +66,16 @@ static struct regmap_irq_sub_irq_map pm8008_sub_reg_offsets[] = {
 	REGMAP_IRQ_MAIN_REG_OFFSET(p3_offs),
 };

-static unsigned int pm8008_virt_regs[] = {
-	PM8008_POLARITY_HI_BASE,
-	PM8008_POLARITY_LO_BASE,
-};
-
 enum {
+	SET_TYPE_INDEX,
 	POLARITY_HI_INDEX,
 	POLARITY_LO_INDEX,
-	PM8008_NUM_VIRT_REGS,
+};
+
+static unsigned int pm8008_config_regs[] = {
+	PM8008_TYPE_BASE,
+	PM8008_POLARITY_HI_BASE,
+	PM8008_POLARITY_LO_BASE,
 };

 static struct regmap_irq pm8008_irqs[] = {
@@ -88,32 +89,37 @@ static struct regmap_irq pm8008_irqs[] = {
 	REGMAP_IRQ_REG(PM8008_IRQ_GPIO2,	PM8008_GPIO2,	BIT(0)),
 };

-static int pm8008_set_type_virt(unsigned int **virt_buf,
-				     unsigned int type, unsigned long hwirq,
-				     int reg)
+static int pm8008_set_type_config(unsigned int **buf, unsigned int type,
+				 const struct regmap_irq *irq_data, int idx,
+				 void *irq_drv_data)
 {
 	switch (type) {
 	case IRQ_TYPE_EDGE_FALLING:
 	case IRQ_TYPE_LEVEL_LOW:
-		virt_buf[POLARITY_HI_INDEX][reg] &= ~pm8008_irqs[hwirq].mask;
-		virt_buf[POLARITY_LO_INDEX][reg] |= pm8008_irqs[hwirq].mask;
+		buf[POLARITY_HI_INDEX][idx] &= ~irq_data->mask;
+		buf[POLARITY_LO_INDEX][idx] |= irq_data->mask;
 		break;

 	case IRQ_TYPE_EDGE_RISING:
 	case IRQ_TYPE_LEVEL_HIGH:
-		virt_buf[POLARITY_HI_INDEX][reg] |= pm8008_irqs[hwirq].mask;
-		virt_buf[POLARITY_LO_INDEX][reg] &= ~pm8008_irqs[hwirq].mask;
+		buf[POLARITY_HI_INDEX][idx] |= irq_data->mask;
+		buf[POLARITY_LO_INDEX][idx] &= ~irq_data->mask;
 		break;

 	case IRQ_TYPE_EDGE_BOTH:
-		virt_buf[POLARITY_HI_INDEX][reg] |= pm8008_irqs[hwirq].mask;
-		virt_buf[POLARITY_LO_INDEX][reg] |= pm8008_irqs[hwirq].mask;
+		buf[POLARITY_HI_INDEX][idx] |= irq_data->mask;
+		buf[POLARITY_LO_INDEX][idx] |= irq_data->mask;
 		break;

 	default:
 		return -EINVAL;
 	}

+	if (type & IRQ_TYPE_EDGE_BOTH)
+		buf[SET_TYPE_INDEX][idx] |= irq_data->mask;
+	else
+		buf[SET_TYPE_INDEX][idx] &= ~irq_data->mask;
+
 	return 0;
 }

@@ -121,21 +127,20 @@ static struct regmap_irq_chip pm8008_irq_chip = {
 	.name			= "pm8008_irq",
 	.main_status		= I2C_INTR_STATUS_BASE,
 	.num_main_regs		= 1,
-	.num_virt_regs		= PM8008_NUM_VIRT_REGS,
 	.irqs			= pm8008_irqs,
 	.num_irqs		= ARRAY_SIZE(pm8008_irqs),
 	.num_regs		= PM8008_NUM_PERIPHS,
 	.not_fixed_stride	= true,
 	.sub_reg_offsets	= pm8008_sub_reg_offsets,
-	.set_type_virt		= pm8008_set_type_virt,
 	.status_base		= PM8008_STATUS_BASE,
 	.mask_base		= PM8008_MASK_BASE,
 	.unmask_base		= PM8008_UNMASK_BASE,
 	.mask_unmask_non_inverted = true,
-	.type_base		= PM8008_TYPE_BASE,
 	.ack_base		= PM8008_ACK_BASE,
-	.virt_reg_base		= pm8008_virt_regs,
-	.num_type_reg		= PM8008_NUM_PERIPHS,
+	.config_base		= pm8008_config_regs,
+	.num_config_bases	= ARRAY_SIZE(pm8008_config_regs),
+	.num_config_regs	= PM8008_NUM_PERIPHS,
+	.set_type_config	= pm8008_set_type_config,
 };

 static struct regmap_config qcom_mfd_regmap_cfg = {
@@ -185,11 +190,7 @@ static int pm8008_probe_irq_peripherals(struct device *dev,
 	for (i = 0; i < ARRAY_SIZE(pm8008_irqs); i++) {
 		type = &pm8008_irqs[i].type;

-		type->type_reg_offset	 = pm8008_irqs[i].reg_offset;
-		type->type_rising_val	 = pm8008_irqs[i].mask;
-		type->type_falling_val	 = pm8008_irqs[i].mask;
-		type->type_level_high_val = 0;
-		type->type_level_low_val  = 0;
+		type->type_reg_offset = pm8008_irqs[i].reg_offset;

 		if (type->type_reg_offset == PM8008_MISC)
 			type->types_supported = IRQ_TYPE_EDGE_RISING;

--
Lee Jones [李琼斯]

  reply	other threads:[~2023-04-06  7:37 UTC|newest]

Thread overview: 127+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06  2:00 linux-next: build failure after merge of the mfd tree Stephen Rothwell
2023-04-06  7:36 ` Lee Jones [this message]
2023-04-06 17:22   ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2023-03-31  1:15 Stephen Rothwell
2022-07-05  1:54 Stephen Rothwell
2022-07-05 12:32 ` Lee Jones
2022-07-05 14:26   ` Aidan MacDonald
2022-02-23 16:54 broonie
2022-02-23 17:03 ` Lee Jones
2022-02-28  6:08   ` Stephen Rothwell
2022-02-28  8:17     ` Lee Jones
     [not found] <20201105014728.GC17266@qmqm.qmqm.pl>
2020-11-05  1:50 ` Stephen Rothwell
2020-11-05  1:57   ` Michał Mirosław
2020-11-05  9:09     ` Lee Jones
2020-07-17  3:41 Stephen Rothwell
2020-07-17  6:56 ` Lee Jones
2020-07-17  6:59   ` Stephen Rothwell
2020-07-17  7:11     ` Lee Jones
2020-02-04  3:03 Stephen Rothwell
2020-02-04  7:53 ` Lee Jones
2020-02-04 10:04   ` Srinivas Kandagatla
2019-04-03  0:40 Stephen Rothwell
2018-12-17  5:38 Stephen Rothwell
2017-12-04  3:19 Stephen Rothwell
2017-12-04  9:10 ` Greg KH
2017-12-04  9:39 ` Lee Jones
2017-12-05 23:32   ` Stephen Rothwell
2017-12-06  8:58     ` Lee Jones
2017-12-12  2:13       ` Stephen Rothwell
2017-12-12  8:13         ` Lee Jones
2017-12-12 11:54           ` Stephen Rothwell
2017-05-31  2:23 Stephen Rothwell
2017-05-31  3:36 ` Stephen Rothwell
2017-06-05  3:28 ` Stephen Rothwell
2017-04-04  6:44 Stephen Rothwell
2017-04-04  8:19 ` Lee Jones
2017-04-04  8:21   ` Lee Jones
2017-04-04 12:31     ` Andy Shevchenko
2017-04-10  2:11       ` Stephen Rothwell
2017-04-10  6:55         ` Lee Jones
2017-04-10  7:53           ` Stephen Rothwell
2016-02-29  3:51 Stephen Rothwell
2016-03-01  1:19 ` Kuninori Morimoto
2016-03-01  1:35   ` Kuninori Morimoto
2016-03-02  4:00     ` Mark Brown
2015-10-15  2:26 Stephen Rothwell
2015-10-15  3:35 ` kbuild test robot
2015-10-15  8:59 ` Arnd Bergmann
2015-10-15  9:17   ` Lee Jones
2015-10-15  9:45   ` Andy Shevchenko
2015-10-15 12:04   ` Christoph Hellwig
2015-10-15 12:28     ` Arnd Bergmann
2015-10-16  1:27       ` Stephen Rothwell
2015-10-16 10:10         ` Arnd Bergmann
2015-03-04  0:34 Stephen Rothwell
2015-03-04  0:37 ` Stephen Rothwell
2015-03-04  7:26 ` Sascha Hauer
2014-11-11  2:32 Stephen Rothwell
2014-11-04  5:40 Stephen Rothwell
2014-11-04  7:54 ` Krzysztof Kozlowski
2014-11-04  8:09   ` Lee Jones
2014-08-22 16:56 Stephen Rothwell
2014-08-22 19:09 ` Lee Jones
2013-04-08  4:21 Stephen Rothwell
2013-04-08  4:45 ` Alexander Shiyan
2013-04-08  9:22   ` Samuel Ortiz
2013-04-08 16:27     ` Re[2]: " Alexander Shiyan
2013-04-09  7:20       ` Samuel Ortiz
2013-04-09 15:47         ` Re[2]: " Alexander Shiyan
2013-04-09 16:12           ` Samuel Ortiz
2013-04-09 16:50             ` Rob Herring
2013-04-09 20:51               ` Samuel Ortiz
2012-09-25  3:47 Stephen Rothwell
2012-09-25  6:47 ` Matthias Kaehlcke
2012-09-25  8:43 ` Samuel Ortiz
2012-07-09  3:57 Stephen Rothwell
2012-07-09 10:52 ` Samuel Ortiz
2012-07-10  9:20 ` Samuel Ortiz
2012-05-21  3:42 Stephen Rothwell
2012-05-21  8:08 ` Lee Jones
2012-05-21  8:40   ` Stephen Rothwell
2012-05-21  9:01     ` Lee Jones
2012-05-21  9:10       ` Stephen Rothwell
2012-05-21  9:19         ` Lee Jones
2012-05-21  9:54           ` Mark Brown
2012-05-21 10:28             ` Lee Jones
2012-05-22 22:42               ` Samuel Ortiz
2012-05-22 22:52                 ` Stephen Rothwell
2012-05-23 14:34                   ` Samuel Ortiz
2012-05-21  8:30 ` Lee Jones
2012-05-21  9:07   ` Stephen Rothwell
2012-05-16  6:09 Stephen Rothwell
2012-05-18  8:39 ` Samuel Ortiz
2012-05-14  3:37 Stephen Rothwell
2012-05-14 20:22 ` Samuel Ortiz
2012-03-19  2:13 Stephen Rothwell
2012-03-19  6:19 ` Laxman Dewangan
2012-03-20 12:40 ` Samuel Ortiz
2012-02-21  1:31 Stephen Rothwell
2012-02-21 11:32 ` Samuel Ortiz
2011-12-20  3:17 Stephen Rothwell
2011-12-20 17:37 ` Samuel Ortiz
2011-09-19  6:19 Stephen Rothwell
2011-09-19  9:43 ` Samuel Ortiz
2011-09-16  3:55 Stephen Rothwell
2011-09-16  7:16 ` Uwe Kleine-König
2011-09-16  8:39   ` Stephen Rothwell
2011-09-18 17:15 ` Samuel Ortiz
2011-06-21  3:03 Stephen Rothwell
2011-06-21 10:07 ` Mark Brown
2011-06-21 17:58 ` Samuel Ortiz
2011-02-22  3:20 Stephen Rothwell
2011-02-22  9:21 ` Samuel Ortiz
2010-09-16  2:54 Stephen Rothwell
2010-09-19 22:27 ` Samuel Ortiz
2010-08-09  1:40 Stephen Rothwell
2010-08-09  8:51 ` Mike Rapoport
2010-08-09  9:10 ` Samuel Ortiz
2010-05-19  4:03 Stephen Rothwell
2010-05-19  4:23 ` Rabin VINCENT
2010-05-19  9:57   ` Samuel Ortiz
2010-05-19 14:14     ` Stephen Rothwell
2010-04-08  2:57 Stephen Rothwell
2010-04-08  9:33 ` Samuel Ortiz
2010-04-07  5:02 Stephen Rothwell
2010-04-07  8:53 ` Samuel Ortiz
2010-04-07 16:24   ` Stephen Rothwell
2010-04-07  4:51 Stephen Rothwell
2010-04-07  8:52 ` Samuel Ortiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230406073646.GW8371@google.com \
    --to=lee@kernel.org \
    --cc=aidanmacdonald.0x0@gmail.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=william.gray@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).