Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: core: propagate device properties to sub devices drivers

In the similar way like we do for the platform data we propagate the device
properties. For example, in case of Intel LPSS drivers we may provide a
specific property to tell the actual device driver an additional information
such as platform name.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Andy Shevchenko and committed by
Rafael J. Wysocki
4d215cab 55f89a8a

+12
+7
drivers/mfd/mfd-core.c
··· 14 14 #include <linux/kernel.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/acpi.h> 17 + #include <linux/property.h> 17 18 #include <linux/mfd/core.h> 18 19 #include <linux/pm_runtime.h> 19 20 #include <linux/slab.h> ··· 189 188 if (cell->pdata_size) { 190 189 ret = platform_device_add_data(pdev, 191 190 cell->platform_data, cell->pdata_size); 191 + if (ret) 192 + goto fail_alias; 193 + } 194 + 195 + if (cell->pset) { 196 + ret = platform_device_add_properties(pdev, cell->pset); 192 197 if (ret) 193 198 goto fail_alias; 194 199 }
+5
include/linux/mfd/core.h
··· 17 17 #include <linux/platform_device.h> 18 18 19 19 struct irq_domain; 20 + struct property_set; 20 21 21 22 /* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */ 22 23 struct mfd_cell_acpi_match { ··· 45 44 /* platform data passed to the sub devices drivers */ 46 45 void *platform_data; 47 46 size_t pdata_size; 47 + 48 + /* device properties passed to the sub devices drivers */ 49 + const struct property_set *pset; 50 + 48 51 /* 49 52 * Device Tree compatible string 50 53 * See: Documentation/devicetree/usage-model.txt Chapter 2.2 for details