diff mbox series

[v1,3/4] mfd: intel_quark_i2c_gpio: Convert GPIO to use software nodes

Message ID 20210726125436.58685-3-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/4] gpio: dwapb: Unify ACPI enumeration checks in get_irq() and configure_irqs() | expand

Commit Message

Andy Shevchenko July 26, 2021, 12:54 p.m. UTC
The driver can provide a software node group instead of
passing legacy platform data. This will allow to drop
the legacy platform data structures along with unifying
a child device driver to use same interface for all
property providers, i.e. Device Tree, ACPI, and board files.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mfd/intel_quark_i2c_gpio.c | 70 ++++++++++++++++--------------
 1 file changed, 37 insertions(+), 33 deletions(-)

Comments

Linus Walleij Aug. 11, 2021, 8:38 a.m. UTC | #1
On Mon, Jul 26, 2021 at 2:54 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> The driver can provide a software node group instead of
> passing legacy platform data. This will allow to drop
> the legacy platform data structures along with unifying
> a child device driver to use same interface for all
> property providers, i.e. Device Tree, ACPI, and board files.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

This is really nice, I wish I knew better how to use this mechanism
myself, so I need to practice.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Andy Shevchenko Aug. 11, 2021, 10:55 a.m. UTC | #2
On Wed, Aug 11, 2021 at 11:38 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Jul 26, 2021 at 2:54 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>
> > The driver can provide a software node group instead of
> > passing legacy platform data. This will allow to drop
> > the legacy platform data structures along with unifying
> > a child device driver to use same interface for all
> > property providers, i.e. Device Tree, ACPI, and board files.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> This is really nice, I wish I knew better how to use this mechanism
> myself, so I need to practice.

This driver is actually a complex enough example covering 90%+ cases
of software nodes in the board files.

> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks!
Lee Jones Aug. 16, 2021, 1:05 p.m. UTC | #3
On Mon, 26 Jul 2021, Andy Shevchenko wrote:

> The driver can provide a software node group instead of
> passing legacy platform data. This will allow to drop
> the legacy platform data structures along with unifying
> a child device driver to use same interface for all
> property providers, i.e. Device Tree, ACPI, and board files.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/mfd/intel_quark_i2c_gpio.c | 70 ++++++++++++++++--------------
>  1 file changed, 37 insertions(+), 33 deletions(-)

Doesn't seem to want to apply.
Andy Shevchenko Aug. 16, 2021, 1:18 p.m. UTC | #4
On Mon, Aug 16, 2021 at 4:11 PM Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 26 Jul 2021, Andy Shevchenko wrote:
>
> > The driver can provide a software node group instead of
> > passing legacy platform data. This will allow to drop
> > the legacy platform data structures along with unifying
> > a child device driver to use same interface for all
> > property providers, i.e. Device Tree, ACPI, and board files.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/mfd/intel_quark_i2c_gpio.c | 70 ++++++++++++++++--------------
> >  1 file changed, 37 insertions(+), 33 deletions(-)
>
> Doesn't seem to want to apply.

Would it be okay for you to pull the immutable tag?
Lee Jones Aug. 16, 2021, 1:33 p.m. UTC | #5
On Mon, 16 Aug 2021, Andy Shevchenko wrote:

> On Mon, Aug 16, 2021 at 4:11 PM Lee Jones <lee.jones@linaro.org> wrote:
> > On Mon, 26 Jul 2021, Andy Shevchenko wrote:
> >
> > > The driver can provide a software node group instead of
> > > passing legacy platform data. This will allow to drop
> > > the legacy platform data structures along with unifying
> > > a child device driver to use same interface for all
> > > property providers, i.e. Device Tree, ACPI, and board files.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > ---
> > >  drivers/mfd/intel_quark_i2c_gpio.c | 70 ++++++++++++++++--------------
> > >  1 file changed, 37 insertions(+), 33 deletions(-)
> >
> > Doesn't seem to want to apply.
> 
> Would it be okay for you to pull the immutable tag?

What immutable tag?
Andy Shevchenko Aug. 16, 2021, 2 p.m. UTC | #6
On Mon, Aug 16, 2021 at 02:33:28PM +0100, Lee Jones wrote:
> On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> 
> > On Mon, Aug 16, 2021 at 4:11 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > On Mon, 26 Jul 2021, Andy Shevchenko wrote:
> > >
> > > > The driver can provide a software node group instead of
> > > > passing legacy platform data. This will allow to drop
> > > > the legacy platform data structures along with unifying
> > > > a child device driver to use same interface for all
> > > > property providers, i.e. Device Tree, ACPI, and board files.
> > > >
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > ---
> > > >  drivers/mfd/intel_quark_i2c_gpio.c | 70 ++++++++++++++++--------------
> > > >  1 file changed, 37 insertions(+), 33 deletions(-)
> > >
> > > Doesn't seem to want to apply.
> > 
> > Would it be okay for you to pull the immutable tag?
> 
> What immutable tag?

It's here:
https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git/tag/?h=intel-gpio-v5.15-1
Lee Jones Aug. 16, 2021, 2:19 p.m. UTC | #7
On Mon, 16 Aug 2021, Andy Shevchenko wrote:

> On Mon, Aug 16, 2021 at 02:33:28PM +0100, Lee Jones wrote:
> > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> > 
> > > On Mon, Aug 16, 2021 at 4:11 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > On Mon, 26 Jul 2021, Andy Shevchenko wrote:
> > > >
> > > > > The driver can provide a software node group instead of
> > > > > passing legacy platform data. This will allow to drop
> > > > > the legacy platform data structures along with unifying
> > > > > a child device driver to use same interface for all
> > > > > property providers, i.e. Device Tree, ACPI, and board files.
> > > > >
> > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > > ---
> > > > >  drivers/mfd/intel_quark_i2c_gpio.c | 70 ++++++++++++++++--------------
> > > > >  1 file changed, 37 insertions(+), 33 deletions(-)
> > > >
> > > > Doesn't seem to want to apply.
> > > 
> > > Would it be okay for you to pull the immutable tag?
> > 
> > What immutable tag?
> 
> It's here:
> https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git/tag/?h=intel-gpio-v5.15-1

My Ack can't be merged like that.
Andy Shevchenko Aug. 16, 2021, 2:53 p.m. UTC | #8
On Mon, Aug 16, 2021 at 5:19 PM Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> > On Mon, Aug 16, 2021 at 02:33:28PM +0100, Lee Jones wrote:
> > > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> > > > On Mon, Aug 16, 2021 at 4:11 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > > On Mon, 26 Jul 2021, Andy Shevchenko wrote:
> > > > >
> > > > > > The driver can provide a software node group instead of
> > > > > > passing legacy platform data. This will allow to drop
> > > > > > the legacy platform data structures along with unifying
> > > > > > a child device driver to use same interface for all
> > > > > > property providers, i.e. Device Tree, ACPI, and board files.
> > > > > >
> > > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > > > ---
> > > > > >  drivers/mfd/intel_quark_i2c_gpio.c | 70 ++++++++++++++++--------------
> > > > > >  1 file changed, 37 insertions(+), 33 deletions(-)
> > > > >
> > > > > Doesn't seem to want to apply.
> > > >
> > > > Would it be okay for you to pull the immutable tag?
> > >
> > > What immutable tag?
> >
> > It's here:
> > https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git/tag/?h=intel-gpio-v5.15-1
>
> My Ack can't be merged like that.

Which one? There are two on different patches.
Do you have any documentation on the rules you imply by MFD?
Lee Jones Aug. 17, 2021, 7:26 a.m. UTC | #9
On Mon, 16 Aug 2021, Andy Shevchenko wrote:

> On Mon, Aug 16, 2021 at 5:19 PM Lee Jones <lee.jones@linaro.org> wrote:
> > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> > > On Mon, Aug 16, 2021 at 02:33:28PM +0100, Lee Jones wrote:
> > > > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> > > > > On Mon, Aug 16, 2021 at 4:11 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > > > On Mon, 26 Jul 2021, Andy Shevchenko wrote:
> > > > > >
> > > > > > > The driver can provide a software node group instead of
> > > > > > > passing legacy platform data. This will allow to drop
> > > > > > > the legacy platform data structures along with unifying
> > > > > > > a child device driver to use same interface for all
> > > > > > > property providers, i.e. Device Tree, ACPI, and board files.
> > > > > > >
> > > > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > > > > ---
> > > > > > >  drivers/mfd/intel_quark_i2c_gpio.c | 70 ++++++++++++++++--------------
> > > > > > >  1 file changed, 37 insertions(+), 33 deletions(-)
> > > > > >
> > > > > > Doesn't seem to want to apply.
> > > > >
> > > > > Would it be okay for you to pull the immutable tag?
> > > >
> > > > What immutable tag?
> > >
> > > It's here:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git/tag/?h=intel-gpio-v5.15-1
> >
> > My Ack can't be merged like that.
> 
> Which one? There are two on different patches.

The one that I specifically said was "for my own reference".

> Do you have any documentation on the rules you imply by MFD?

No, the documentation is provided with the tag.
Andy Shevchenko Aug. 17, 2021, 11:23 a.m. UTC | #10
On Tue, Aug 17, 2021 at 10:26 AM Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> > On Mon, Aug 16, 2021 at 5:19 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > On Mon, 16 Aug 2021, Andy Shevchenko wrote:

...

> > > > > > Would it be okay for you to pull the immutable tag?
> > > > >
> > > > > What immutable tag?
> > > >
> > > > It's here:
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git/tag/?h=intel-gpio-v5.15-1
> > >
> > > My Ack can't be merged like that.
> >
> > Which one? There are two on different patches.
>
> The one that I specifically said was "for my own reference".
>
> > Do you have any documentation on the rules you imply by MFD?
>
> No, the documentation is provided with the tag.

I see.

So, what is the recommended solution?
Lee Jones Aug. 18, 2021, 6:34 a.m. UTC | #11
On Tue, 17 Aug 2021, Andy Shevchenko wrote:

> On Tue, Aug 17, 2021 at 10:26 AM Lee Jones <lee.jones@linaro.org> wrote:
> > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> > > On Mon, Aug 16, 2021 at 5:19 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> 
> ...
> 
> > > > > > > Would it be okay for you to pull the immutable tag?
> > > > > >
> > > > > > What immutable tag?
> > > > >
> > > > > It's here:
> > > > > https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git/tag/?h=intel-gpio-v5.15-1
> > > >
> > > > My Ack can't be merged like that.
> > >
> > > Which one? There are two on different patches.
> >
> > The one that I specifically said was "for my own reference".
> >
> > > Do you have any documentation on the rules you imply by MFD?
> >
> > No, the documentation is provided with the tag.
> 
> I see.
> 
> So, what is the recommended solution?

I planned to take the patch.

I'm also happy to take the set, if they are interdependent.

What is the reason the MFD patch doesn't apply to my tree?
Andy Shevchenko Aug. 18, 2021, 11:04 a.m. UTC | #12
On Wed, Aug 18, 2021 at 9:34 AM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Tue, 17 Aug 2021, Andy Shevchenko wrote:
>
> > On Tue, Aug 17, 2021 at 10:26 AM Lee Jones <lee.jones@linaro.org> wrote:
> > > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> > > > On Mon, Aug 16, 2021 at 5:19 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> >
> > ...
> >
> > > > > > > > Would it be okay for you to pull the immutable tag?
> > > > > > >
> > > > > > > What immutable tag?
> > > > > >
> > > > > > It's here:
> > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git/tag/?h=intel-gpio-v5.15-1
> > > > >
> > > > > My Ack can't be merged like that.
> > > >
> > > > Which one? There are two on different patches.
> > >
> > > The one that I specifically said was "for my own reference".
> > >
> > > > Do you have any documentation on the rules you imply by MFD?
> > >
> > > No, the documentation is provided with the tag.
> >
> > I see.
> >
> > So, what is the recommended solution?
>
> I planned to take the patch.
>
> I'm also happy to take the set, if they are interdependent.
>
> What is the reason the MFD patch doesn't apply to my tree?

What I did right now:

$ git checkout -b test-mfd-merge mfd/for-mfd-next
Updating files: 100% (8674/8674), done.
Branch 'test-mfd-merge' set up to track remote branch 'for-mfd-next' from 'mfd'.
Switched to a new branch 'test-mfd-merge'

$ b4 am 20210726125436.58685-2-andriy.shevchenko@linux.intel.com
Looking up https://lore.kernel.org/r/20210726125436.58685-2-andriy.shevchenko%40linux.intel.com
Grabbing thread from lore.kernel.org/linux-gpio
Analyzing 28 messages in the thread
---
Writing ./20210726_andriy_shevchenko_gpio_dwapb_unify_acpi_enumeration_checks_in_get_irq_and_configure_irqs.mbx
  [PATCH v1 1/4] gpio: dwapb: Unify ACPI enumeration checks in
get_irq() and configure_irqs()
    + Acked-by: Lee Jones <lee.jones@linaro.org> (✓ DKIM/linaro.org)
    + Acked-by: Serge Semin <fancer.lancer@gmail.com> (✓ DKIM/gmail.com)
    + Tested-by: Serge Semin <fancer.lancer@gmail.com> (✓ DKIM/gmail.com)
  [PATCH v1 2/4] gpio: dwapb: Read GPIO base from gpio-base property
  [PATCH v1 3/4] mfd: intel_quark_i2c_gpio: Convert GPIO to use software nodes
    + Reviewed-by: Linus Walleij <linus.walleij@linaro.org> (✓ DKIM/linaro.org)
  [PATCH v1 4/4] gpio: dwapb: Get rid of legacy platform data
    + Acked-by: Serge Semin <fancer.lancer@gmail.com> (✓ DKIM/gmail.com)
    + Tested-by: Serge Semin <fancer.lancer@gmail.com> (✓ DKIM/gmail.com)
---
Total patches: 4
---
 Link: https://lore.kernel.org/r/20210726125436.58685-1-andriy.shevchenko@linux.intel.com
 Base: not found (applies clean to current tree)
       git am ./20210726_andriy_shevchenko_gpio_dwapb_unify_acpi_enumeration_checks_in_get_irq_and_configure_irqs.mbx

$ git am ./20210726_andriy_shevchenko_gpio_dwapb_unify_acpi_enumeration_checks_in_get_irq_and_configure_irqs.mbx
Applying: gpio: dwapb: Unify ACPI enumeration checks in get_irq() and
configure_irqs()
Applying: gpio: dwapb: Read GPIO base from gpio-base property
Applying: mfd: intel_quark_i2c_gpio: Convert GPIO to use software nodes
Applying: gpio: dwapb: Get rid of legacy platform data

### here we need to rebase and add your tag

No conflicts, no nothing with your current _published_ for-mfd-next.
Do you have local changes that have not been yet visible?

Alternatively you may pull the tag I have.
Lee Jones Sept. 21, 2021, 3:25 p.m. UTC | #13
On Tue, 17 Aug 2021, Andy Shevchenko wrote:

> On Tue, Aug 17, 2021 at 10:26 AM Lee Jones <lee.jones@linaro.org> wrote:
> > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> > > On Mon, Aug 16, 2021 at 5:19 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > On Mon, 16 Aug 2021, Andy Shevchenko wrote:
> 
> ...
> 
> > > > > > > Would it be okay for you to pull the immutable tag?
> > > > > >
> > > > > > What immutable tag?
> > > > >
> > > > > It's here:
> > > > > https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git/tag/?h=intel-gpio-v5.15-1
> > > >
> > > > My Ack can't be merged like that.
> > >
> > > Which one? There are two on different patches.
> >
> > The one that I specifically said was "for my own reference".
> >
> > > Do you have any documentation on the rules you imply by MFD?
> >
> > No, the documentation is provided with the tag.
> 
> I see.

And now the patch is merged with an invalid tag! *facepalm*
diff mbox series

Patch

diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c
index a43993e38b6e..9b9c76bd067b 100644
--- a/drivers/mfd/intel_quark_i2c_gpio.c
+++ b/drivers/mfd/intel_quark_i2c_gpio.c
@@ -17,7 +17,6 @@ 
 #include <linux/clk-provider.h>
 #include <linux/dmi.h>
 #include <linux/i2c.h>
-#include <linux/platform_data/gpio-dwapb.h>
 #include <linux/property.h>
 
 /* PCI BAR for register base address */
@@ -28,15 +27,6 @@ 
 #define MFD_ACPI_MATCH_GPIO	0ULL
 #define MFD_ACPI_MATCH_I2C	1ULL
 
-/* The base GPIO number under GPIOLIB framework */
-#define INTEL_QUARK_MFD_GPIO_BASE	8
-
-/* The default number of South-Cluster GPIO on Quark. */
-#define INTEL_QUARK_MFD_NGPIO		8
-
-/* The DesignWare GPIO ports on Quark. */
-#define INTEL_QUARK_GPIO_NPORTS	1
-
 #define INTEL_QUARK_IORES_MEM	0
 #define INTEL_QUARK_IORES_IRQ	1
 
@@ -111,12 +101,38 @@  static struct resource intel_quark_gpio_res[] = {
 	[INTEL_QUARK_IORES_MEM] = {
 		.flags = IORESOURCE_MEM,
 	},
+	[INTEL_QUARK_IORES_IRQ] = {
+		.flags = IORESOURCE_IRQ,
+	},
 };
 
 static struct mfd_cell_acpi_match intel_quark_acpi_match_gpio = {
 	.adr = MFD_ACPI_MATCH_GPIO,
 };
 
+static const struct software_node intel_quark_gpio_controller_node = {
+	.name = "intel-quark-gpio-controller",
+};
+
+static const struct property_entry intel_quark_gpio_portA_properties[] = {
+	PROPERTY_ENTRY_U32("reg", 0),
+	PROPERTY_ENTRY_U32("snps,nr-gpios", 8),
+	PROPERTY_ENTRY_U32("gpio-base", 8),
+	{ }
+};
+
+static const struct software_node intel_quark_gpio_portA_node = {
+	.name = "portA",
+	.parent = &intel_quark_gpio_controller_node,
+	.properties = intel_quark_gpio_portA_properties,
+};
+
+static const struct software_node *intel_quark_gpio_node_group[] = {
+	&intel_quark_gpio_controller_node,
+	&intel_quark_gpio_portA_node,
+	NULL
+};
+
 static struct mfd_cell intel_quark_mfd_cells[] = {
 	[MFD_I2C_BAR] = {
 		.id = MFD_I2C_BAR,
@@ -203,34 +219,19 @@  static int intel_quark_gpio_setup(struct pci_dev *pdev)
 {
 	struct mfd_cell *cell = &intel_quark_mfd_cells[MFD_GPIO_BAR];
 	struct resource *res = intel_quark_gpio_res;
-	struct dwapb_platform_data *pdata;
-	struct device *dev = &pdev->dev;
+	int ret;
 
 	res[INTEL_QUARK_IORES_MEM].start = pci_resource_start(pdev, MFD_GPIO_BAR);
 	res[INTEL_QUARK_IORES_MEM].end = pci_resource_end(pdev, MFD_GPIO_BAR);
 
-	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
-	if (!pdata)
-		return -ENOMEM;
-
-	/* For intel quark x1000, it has only one port: portA */
-	pdata->nports = INTEL_QUARK_GPIO_NPORTS;
-	pdata->properties = devm_kcalloc(dev, pdata->nports,
-					 sizeof(*pdata->properties),
-					 GFP_KERNEL);
-	if (!pdata->properties)
-		return -ENOMEM;
-
-	/* Set the properties for portA */
-	pdata->properties->fwnode	= NULL;
-	pdata->properties->idx		= 0;
-	pdata->properties->ngpio	= INTEL_QUARK_MFD_NGPIO;
-	pdata->properties->gpio_base	= INTEL_QUARK_MFD_GPIO_BASE;
-	pdata->properties->irq[0]	= pci_irq_vector(pdev, 0);
+	res[INTEL_QUARK_IORES_IRQ].start = pci_irq_vector(pdev, 0);
+	res[INTEL_QUARK_IORES_IRQ].end = pci_irq_vector(pdev, 0);
 
-	cell->platform_data = pdata;
-	cell->pdata_size = sizeof(*pdata);
+	ret = software_node_register_node_group(intel_quark_gpio_node_group);
+	if (ret)
+		return ret;
 
+	cell->swnode = &intel_quark_gpio_controller_node;
 	return 0;
 }
 
@@ -273,10 +274,12 @@  static int intel_quark_mfd_probe(struct pci_dev *pdev,
 			      ARRAY_SIZE(intel_quark_mfd_cells), NULL, 0,
 			      NULL);
 	if (ret)
-		goto err_free_irq_vectors;
+		goto err_unregister_gpio_node_group;
 
 	return 0;
 
+err_unregister_gpio_node_group:
+	software_node_unregister_node_group(intel_quark_gpio_node_group);
 err_free_irq_vectors:
 	pci_free_irq_vectors(pdev);
 err_unregister_i2c_clk:
@@ -287,6 +290,7 @@  static int intel_quark_mfd_probe(struct pci_dev *pdev,
 static void intel_quark_mfd_remove(struct pci_dev *pdev)
 {
 	mfd_remove_devices(&pdev->dev);
+	software_node_unregister_node_group(intel_quark_gpio_node_group);
 	pci_free_irq_vectors(pdev);
 	intel_quark_unregister_i2c_clk(&pdev->dev);
 }