Skip to contentSkip to conversation

MFD core updates for device tree binding support

PATCH Applied Robert Hancock 2 participants 11 messages Jun 4, 2019 – Jun 10, 2019 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

cover MFD core updates for device tree binding support

Fixes for the device tree binding support in MFD core.

Robert Hancock (2):
mfd: core: Support multiple OF child devices of the same type
mfd: core: Set fwnode for created devices

 drivers/mfd/mfd-core.c   | 6 +++++-
 include/linux/mfd/core.h | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/2 mfd: core: Support multiple OF child devices of the same type

Previously the MFD core supported assigning OF nodes to created MFD devices, but relied solely on matching the of_compatible string. This would result in devices being potentially assigned the wrong node if there are multiple devices with the same compatible string within a multifunction device.

Add support for matching the full name of the node in the MFD cell definition, so that we can match against a specific instance of a device. If this is not specified, we match just based on the compatible string, as before.

---
 drivers/mfd/mfd-core.c   | 5 ++++-
 include/linux/mfd/core.h | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/mfd/mfd-core.c +4 -1
index 1ade4c8..74bc895 100644
@@ -177,7 +177,10 @@ static int mfd_add_device(struct device *parent, int id,
 
 	if (parent->of_node && cell->of_compatible) {
 		for_each_child_of_node(parent->of_node, np) {
-			if (of_device_is_compatible(np, cell->of_compatible)) {
+			if (of_device_is_compatible(np, cell->of_compatible) &&
+			    (!cell->of_full_name ||
+			     !strcmp(cell->of_full_name,
+				     of_node_full_name(np)))) {
 				pdev->dev.of_node = np;
 				break;
 			}
include/linux/mfd/core.h +3 -0
index 99c0395..470f6cb 100644
@@ -55,6 +55,9 @@ struct mfd_cell {
 	 */
 	const char		*of_compatible;
 
+	/* Optionally match against a specific device of a given type */
+	const char		*of_full_name;
+
 	/* Matches ACPI */
 	const struct mfd_cell_acpi_match	*acpi_match;
 
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [PATCH 1/2] mfd: core: Support multiple OF child devices of the same type

Quoted 22 lines · Robert Hancock

Previously the MFD core supported assigning OF nodes to created MFD devices, but relied solely on matching the of_compatible string. This would result in devices being potentially assigned the wrong node if there are multiple devices with the same compatible string within a multifunction device.

Add support for matching the full name of the node in the MFD cell definition, so that we can match against a specific instance of a device. If this is not specified, we match just based on the compatible string, as before.

---
 drivers/mfd/mfd-core.c   | 5 ++++-
 include/linux/mfd/core.h | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/mfd/mfd-core.c +0 -0
index 1ade4c8..74bc895 100644

drivers/mfd/mfd-core.c static int mfd_add_device(struct device *parent, int id, · line 185

Quoted 10 lines
drivers/mfd/mfd-core.c +4 -1
@@ -177,7 +177,10 @@ static int mfd_add_device(struct device *parent, int id,
 
 	if (parent->of_node && cell->of_compatible) {
 		for_each_child_of_node(parent->of_node, np) {
-			if (of_device_is_compatible(np, cell->of_compatible)) {
+			if (of_device_is_compatible(np, cell->of_compatible) &&
+			    (!cell->of_full_name ||
+			     !strcmp(cell->of_full_name,
+				     of_node_full_name(np)))) {
 				pdev->dev.of_node = np;
 				break;

That is some ugly, squashed up code.

If we end up accepting this, I suggest flattening this out a bit.

... but we'll cross that bridge when we come to it.

include/linux/mfd/core.h struct mfd_cell { · line 60

Quoted 11 lines
include/linux/mfd/core.h +3 -0
index 99c0395..470f6cb 100644
@@ -55,6 +55,9 @@ struct mfd_cell {
 	 */
 	const char		*of_compatible;
 
+	/* Optionally match against a specific device of a given type */
+	const char		*of_full_name;
+

Can you give me an example for when this might be useful?

Quoted 3 lines
include/linux/mfd/core.h +0 -0
 	/* Matches ACPI */
 	const struct mfd_cell_acpi_match	*acpi_match;
 
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw

Re: [PATCH 1/2] mfd: core: Support multiple OF child devices of the same type

Quoted 37 lines · Lee Jones
Quoted 22 lines · Robert Hancock

Previously the MFD core supported assigning OF nodes to created MFD devices, but relied solely on matching the of_compatible string. This would result in devices being potentially assigned the wrong node if there are multiple devices with the same compatible string within a multifunction device.

Add support for matching the full name of the node in the MFD cell definition, so that we can match against a specific instance of a device. If this is not specified, we match just based on the compatible string, as before.

---
 drivers/mfd/mfd-core.c   | 5 ++++-
 include/linux/mfd/core.h | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/mfd/mfd-core.c +0 -0
index 1ade4c8..74bc895 100644

drivers/mfd/mfd-core.c static int mfd_add_device(struct device *parent, int id, · line 185

Quoted 10 lines
drivers/mfd/mfd-core.c +4 -1
@@ -177,7 +177,10 @@ static int mfd_add_device(struct device *parent, int id,
 
 	if (parent->of_node && cell->of_compatible) {
 		for_each_child_of_node(parent->of_node, np) {
-			if (of_device_is_compatible(np, cell->of_compatible)) {
+			if (of_device_is_compatible(np, cell->of_compatible) &&
+			    (!cell->of_full_name ||
+			     !strcmp(cell->of_full_name,
+				     of_node_full_name(np)))) {
 				pdev->dev.of_node = np;
 				break;

That is some ugly, squashed up code.

Quoted 3 lines

If we end up accepting this, I suggest flattening this out a bit.

... but we'll cross that bridge when we come to it.

Yes, that if statement could be broken up to make it more readable. Will fix in a next version assuming the concept is acceptable.

Quoted 9 lines
Quoted 9 lines
include/linux/mfd/core.h +0 -0
index 99c0395..470f6cb 100644
@@ -55,6 +55,9 @@ struct mfd_cell {
 	 */
 	const char		*of_compatible;
 
Quoted 5 lines

include/linux/mfd/core.h struct mfd_cell { · line 60

Quoted 3 lines
include/linux/mfd/core.h +3 -0
+	/* Optionally match against a specific device of a given type */
+	const char		*of_full_name;
+

Can you give me an example for when this might be useful?

This is an example of some device tree entries for our MFD device:

            axi_iic_0: i2c@c0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <7>;
                #size-cells = <0>;
                #address-cells = <1>;
            };

            axi_iic_1: i2c@d0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <8>;
                #size-cells = <0>;
                #address-cells = <1>;
            };

and the corresponding MFD cells:

{
	.name		= "axi_iic_0",
	.of_compatible	= "xlnx,xps-iic-2.00.a",
	.of_full_name	= "i2c@c0000",
	.num_resources	= ARRAY_SIZE(dbe_i2c1_resources),
	.resources	= dbe_i2c1_resources
},
{
	.name		= "axi_iic_1",
	.of_compatible	= "xlnx,xps-iic-2.00.a",
	.of_full_name	= "i2c@d0000",
	.num_resources	= ARRAY_SIZE(dbe_i2c2_resources),
	.resources	= dbe_i2c2_resources
},

Without having the .of_full_name support, both MFD cells ended up wrongly matching against the i2c@c0000 device tree node since we just picked the first one where of_compatible matched.

Signature · 4 lines
Robert Hancock
Senior Software Developer
SED Systems, a division of Calian Ltd.
Email: [email protected]
#4 lore raw

Re: [PATCH 1/2] mfd: core: Support multiple OF child devices of the same type

Quoted 97 lines · Robert Hancock
Quoted 37 lines · Lee Jones
Quoted 22 lines · Robert Hancock

Previously the MFD core supported assigning OF nodes to created MFD devices, but relied solely on matching the of_compatible string. This would result in devices being potentially assigned the wrong node if there are multiple devices with the same compatible string within a multifunction device.

Add support for matching the full name of the node in the MFD cell definition, so that we can match against a specific instance of a device. If this is not specified, we match just based on the compatible string, as before.

---
 drivers/mfd/mfd-core.c   | 5 ++++-
 include/linux/mfd/core.h | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/mfd/mfd-core.c +0 -0
index 1ade4c8..74bc895 100644

drivers/mfd/mfd-core.c static int mfd_add_device(struct device *parent, int id, · line 185

Quoted 10 lines
drivers/mfd/mfd-core.c +4 -1
@@ -177,7 +177,10 @@ static int mfd_add_device(struct device *parent, int id,
 
 	if (parent->of_node && cell->of_compatible) {
 		for_each_child_of_node(parent->of_node, np) {
-			if (of_device_is_compatible(np, cell->of_compatible)) {
+			if (of_device_is_compatible(np, cell->of_compatible) &&
+			    (!cell->of_full_name ||
+			     !strcmp(cell->of_full_name,
+				     of_node_full_name(np)))) {
 				pdev->dev.of_node = np;
 				break;

That is some ugly, squashed up code.

Quoted 3 lines

If we end up accepting this, I suggest flattening this out a bit.

... but we'll cross that bridge when we come to it.

Yes, that if statement could be broken up to make it more readable. Will fix in a next version assuming the concept is acceptable.

Quoted 9 lines
Quoted 9 lines
include/linux/mfd/core.h +0 -0
index 99c0395..470f6cb 100644
@@ -55,6 +55,9 @@ struct mfd_cell {
 	 */
 	const char		*of_compatible;
 
Quoted 5 lines

include/linux/mfd/core.h struct mfd_cell { · line 60

Quoted 3 lines
include/linux/mfd/core.h +3 -0
+	/* Optionally match against a specific device of a given type */
+	const char		*of_full_name;
+

Can you give me an example for when this might be useful?

This is an example of some device tree entries for our MFD device:

            axi_iic_0: i2c@c0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <7>;
                #size-cells = <0>;
                #address-cells = <1>;
            };

            axi_iic_1: i2c@d0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <8>;
                #size-cells = <0>;
                #address-cells = <1>;
            };

and the corresponding MFD cells:

{
	.name		= "axi_iic_0",
	.of_compatible	= "xlnx,xps-iic-2.00.a",
	.of_full_name	= "i2c@c0000",
	.num_resources	= ARRAY_SIZE(dbe_i2c1_resources),
	.resources	= dbe_i2c1_resources
},
{
	.name		= "axi_iic_1",
	.of_compatible	= "xlnx,xps-iic-2.00.a",
	.of_full_name	= "i2c@d0000",
	.num_resources	= ARRAY_SIZE(dbe_i2c2_resources),
	.resources	= dbe_i2c2_resources
},
Quoted 3 lines

Without having the .of_full_name support, both MFD cells ended up wrongly matching against the i2c@c0000 device tree node since we just picked the first one where of_compatible matched.

What is contained in each of their resources?

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw

Re: [PATCH 1/2] mfd: core: Support multiple OF child devices of the same type

Quoted 51 lines · Lee Jones
Quoted 51 lines
Quoted 8 lines
Quoted 8 lines
include/linux/mfd/core.h +0 -0
index 99c0395..470f6cb 100644
@@ -55,6 +55,9 @@ struct mfd_cell {
 	 */
 	const char		*of_compatible;
 
Quoted 5 lines

include/linux/mfd/core.h struct mfd_cell { · line 60

Quoted 3 lines
include/linux/mfd/core.h +3 -0
+	/* Optionally match against a specific device of a given type */
+	const char		*of_full_name;
+

Can you give me an example for when this might be useful?

This is an example of some device tree entries for our MFD device:

            axi_iic_0: i2c@c0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <7>;
                #size-cells = <0>;
                #address-cells = <1>;
            };

            axi_iic_1: i2c@d0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <8>;
                #size-cells = <0>;
                #address-cells = <1>;
            };

and the corresponding MFD cells:

{
	.name		= "axi_iic_0",
	.of_compatible	= "xlnx,xps-iic-2.00.a",
	.of_full_name	= "i2c@c0000",
	.num_resources	= ARRAY_SIZE(dbe_i2c1_resources),
	.resources	= dbe_i2c1_resources
},
{
	.name		= "axi_iic_1",
	.of_compatible	= "xlnx,xps-iic-2.00.a",
	.of_full_name	= "i2c@d0000",
	.num_resources	= ARRAY_SIZE(dbe_i2c2_resources),
	.resources	= dbe_i2c2_resources
},
Quoted 5 lines
Quoted 3 lines

Without having the .of_full_name support, both MFD cells ended up wrongly matching against the i2c@c0000 device tree node since we just picked the first one where of_compatible matched.

What is contained in each of their resources?

These are the resource entries for those two devices:

static const struct resource dbe_i2c1_resources[] = {

{
	.start		= 0xc0000,
	.end		= 0xcffff,
	.name		= "xi2c1_regs",
	.flags		= IORESOURCE_MEM,
	.desc		= IORES_DESC_NONE
},

};

static const struct resource dbe_i2c2_resources[] = {

{
	.start		= 0xd0000,
	.end		= 0xdffff,
	.name		= "xi2c2_regs",
	.flags		= IORESOURCE_MEM,
	.desc		= IORES_DESC_NONE
},

};

Ideally the IO memory resource entries would be picked up and mapped through the device tree as well, as they are with the interrupts, but I haven't yet found the device tree magic that would allow that to happen yet, if it's possible. The setup we have has a number of peripherals on an AXI bus which are behind a PCIe to AXI bridge, and we're using mfd to instantiate each of those AXI devices under the PCIe device.

Signature · 4 lines
Robert Hancock
Senior Software Developer
SED Systems, a division of Calian Ltd.
Email: [email protected]
#6 lore raw

Re: [PATCH 1/2] mfd: core: Support multiple OF child devices of the same type

Quoted 71 lines · Robert Hancock
Quoted 51 lines · Lee Jones
Quoted 51 lines
Quoted 8 lines
Quoted 8 lines
include/linux/mfd/core.h +0 -0
index 99c0395..470f6cb 100644
@@ -55,6 +55,9 @@ struct mfd_cell {
 	 */
 	const char		*of_compatible;
 
Quoted 5 lines

include/linux/mfd/core.h struct mfd_cell { · line 60

Quoted 3 lines
include/linux/mfd/core.h +3 -0
+	/* Optionally match against a specific device of a given type */
+	const char		*of_full_name;
+

Can you give me an example for when this might be useful?

This is an example of some device tree entries for our MFD device:

            axi_iic_0: i2c@c0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <7>;
                #size-cells = <0>;
                #address-cells = <1>;
            };

            axi_iic_1: i2c@d0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <8>;
                #size-cells = <0>;
                #address-cells = <1>;
            };

and the corresponding MFD cells:

{
	.name		= "axi_iic_0",
	.of_compatible	= "xlnx,xps-iic-2.00.a",
	.of_full_name	= "i2c@c0000",
	.num_resources	= ARRAY_SIZE(dbe_i2c1_resources),
	.resources	= dbe_i2c1_resources
},
{
	.name		= "axi_iic_1",
	.of_compatible	= "xlnx,xps-iic-2.00.a",
	.of_full_name	= "i2c@d0000",
	.num_resources	= ARRAY_SIZE(dbe_i2c2_resources),
	.resources	= dbe_i2c2_resources
},
Quoted 5 lines
Quoted 3 lines

Without having the .of_full_name support, both MFD cells ended up wrongly matching against the i2c@c0000 device tree node since we just picked the first one where of_compatible matched.

What is contained in each of their resources?

These are the resource entries for those two devices:

static const struct resource dbe_i2c1_resources[] = {

{
	.start		= 0xc0000,
	.end		= 0xcffff,
	.name		= "xi2c1_regs",
	.flags		= IORESOURCE_MEM,
	.desc		= IORES_DESC_NONE
},

};

static const struct resource dbe_i2c2_resources[] = {

Quoted 8 lines
{
	.start		= 0xd0000,
	.end		= 0xdffff,
	.name		= "xi2c2_regs",
	.flags		= IORESOURCE_MEM,
	.desc		= IORES_DESC_NONE
},

};

This is your problem. You are providing the memory resources through *both* DT and MFD. I don't believe I've seen your MFD driver, but it looks like it's probably not required at all. Just allow DT to probe each of your child devices. You can obtain the IO memory from there directly using the usual platform_get_resource() calls.

Quoted 7 lines

Ideally the IO memory resource entries would be picked up and mapped through the device tree as well, as they are with the interrupts, but I haven't yet found the device tree magic that would allow that to happen yet, if it's possible. The setup we have has a number of peripherals on an AXI bus which are behind a PCIe to AXI bridge, and we're using mfd to instantiate each of those AXI devices under the PCIe device.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#7 lore raw

Re: [PATCH 1/2] mfd: core: Support multiple OF child devices of the same type

Quoted 28 lines · Lee Jones
Quoted 19 lines
Quoted 5 lines
Quoted 3 lines

Without having the .of_full_name support, both MFD cells ended up wrongly matching against the i2c@c0000 device tree node since we just picked the first one where of_compatible matched.

What is contained in each of their resources?

These are the resource entries for those two devices:

static const struct resource dbe_i2c1_resources[] = {

{
	.start		= 0xc0000,
	.end		= 0xcffff,
	.name		= "xi2c1_regs",
	.flags		= IORESOURCE_MEM,
	.desc		= IORES_DESC_NONE
},

};

static const struct resource dbe_i2c2_resources[] = {

Quoted 8 lines
{
	.start		= 0xd0000,
	.end		= 0xdffff,
	.name		= "xi2c2_regs",
	.flags		= IORESOURCE_MEM,
	.desc		= IORES_DESC_NONE
},

};

Quoted 5 lines

This is your problem. You are providing the memory resources through *both* DT and MFD. I don't believe I've seen your MFD driver, but it looks like it's probably not required at all. Just allow DT to probe each of your child devices. You can obtain the IO memory from there directly using the usual platform_get_resource() calls.

As far as I can tell, the DT child devices underneath a PCIe device don't get probed and drivers loaded automatically - possibly for valid reasons. The MFD driver appears to be required in order to actually get drivers attached to those DT nodes.

Right now those devices are ending up with no memory resources unless they are injected through the MFD cells. It would be handy if the memory resources were mapped automatically from the PCIe BARs to the sub-devices, to avoid duplicating information in the DT and the driver, but even if that was solved it wouldn't avoid the need for this patch, as the devices would still end up attached to the wrong DT node and pick up the wrong properties.

The other reason we need the MFD driver is we are implementing an IRQ domain to map the interrupts from the PCIe device to the child nodes, and using some of those callbacks to poke other registers on the PCIe to assist with converting the level-triggered AXI interrupts to edge-triggered MSIs.

This is what the outer DT leading up to what I showed earlier looks like.

&pcie {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_pcie>;
    reset-gpio = <&gpio7 12 GPIO_ACTIVE_LOW>;
    status = "okay";

    pci_rootport: pcie@0,0 {
        reg = <0x83000000 0 0 0 0>;
        #address-cells = <3>;
        #size-cells = <2>;
        ranges;

        fpga_pcie: pcie@1,0 {
            reg = <0x2010000 0 0 0 0>;
            #address-cells = <1>;
            #size-cells = <1>;
            interrupt-controller;
            #interrupt-cells = <1>;

            ...

            axi_iic_0: i2c@c0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <7>;
                #size-cells = <0>;
                #address-cells = <1>;
            };

            axi_iic_1: i2c@d0000 {
                compatible = "xlnx,xps-iic-2.00.a";
                clocks = <&axi_clk>;
                clock-frequency = <100000>;
                interrupts = <8>;
                #size-cells = <0>;
                #address-cells = <1>;
            };
        };
    };
};
Quoted 9 lines
Quoted 8 lines

Ideally the IO memory resource entries would be picked up and mapped through the device tree as well, as they are with the interrupts, but I haven't yet found the device tree magic that would allow that to happen yet, if it's possible. The setup we have has a number of peripherals on an AXI bus which are behind a PCIe to AXI bridge, and we're using mfd to instantiate each of those AXI devices under the PCIe device.

Signature · 4 lines
Robert Hancock
Senior Software Developer
SED Systems, a division of Calian Ltd.
Email: [email protected]
#8 lore raw

Re: [PATCH 1/2] mfd: core: Support multiple OF child devices of the same type

Quoted 35 lines · Robert Hancock
Quoted 28 lines · Lee Jones
Quoted 19 lines
Quoted 5 lines
Quoted 3 lines

Without having the .of_full_name support, both MFD cells ended up wrongly matching against the i2c@c0000 device tree node since we just picked the first one where of_compatible matched.

What is contained in each of their resources?

These are the resource entries for those two devices:

static const struct resource dbe_i2c1_resources[] = {

{
	.start		= 0xc0000,
	.end		= 0xcffff,
	.name		= "xi2c1_regs",
	.flags		= IORESOURCE_MEM,
	.desc		= IORES_DESC_NONE
},

};

static const struct resource dbe_i2c2_resources[] = {

Quoted 8 lines
{
	.start		= 0xd0000,
	.end		= 0xdffff,
	.name		= "xi2c2_regs",
	.flags		= IORESOURCE_MEM,
	.desc		= IORES_DESC_NONE
},

};

Quoted 5 lines

This is your problem. You are providing the memory resources through *both* DT and MFD. I don't believe I've seen your MFD driver, but it looks like it's probably not required at all. Just allow DT to probe each of your child devices. You can obtain the IO memory from there directly using the usual platform_get_resource() calls.

Quoted 4 lines

As far as I can tell, the DT child devices underneath a PCIe device don't get probed and drivers loaded automatically - possibly for valid reasons. The MFD driver appears to be required in order to actually get drivers attached to those DT nodes.

You need to call of_platform_populate().

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#9 lore raw

PATCH 2/2 mfd: core: Set fwnode for created devices

In reply to Robert Hancock

The logic for setting the of_node on devices created by mfd did not set the fwnode pointer to match, which caused fwnode-based APIs to malfunction on these devices since the fwnode pointer was null. Fix this.

---
 drivers/mfd/mfd-core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/mfd-core.c +1 -0
index 74bc895..228163c 100644
@@ -182,6 +182,7 @@ static int mfd_add_device(struct device *parent, int id,
 			     !strcmp(cell->of_full_name,
 				     of_node_full_name(np)))) {
 				pdev->dev.of_node = np;
+				pdev->dev.fwnode = &np->fwnode;
 				break;
 			}
 		}
Signature · 1 line
1.8.3.1
Applied
#10 lore raw

Re: [PATCH 2/2] mfd: core: Set fwnode for created devices

Quoted 9 lines · Robert Hancock

The logic for setting the of_node on devices created by mfd did not set the fwnode pointer to match, which caused fwnode-based APIs to malfunction on these devices since the fwnode pointer was null. Fix this.

---
 drivers/mfd/mfd-core.c | 1 +
 1 file changed, 1 insertion(+)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog