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

Merge tag 'device-properties-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull device properties update from Rafael Wysocki:
"Generic device properties framework update.

Just one commit reworking the handling of built-in properties
initialization and updating a few drivers in accordance with the core
framework changes"

* tag 'device-properties-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
device property: don't bother the drivers with struct property_set

+55 -83
+4 -8
arch/arm/mach-pxa/raumfeld.c
··· 385 385 { }, 386 386 }; 387 387 388 - static struct property_set raumfeld_rotary_property_set = { 389 - .properties = raumfeld_rotary_properties, 390 - }; 391 - 392 388 static struct platform_device rotary_encoder_device = { 393 389 .name = "rotary-encoder", 394 390 .id = 0, ··· 1059 1063 pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_controller_pin_config)); 1060 1064 1061 1065 gpiod_add_lookup_table(&raumfeld_rotary_gpios_table); 1062 - device_add_property_set(&rotary_encoder_device.dev, 1063 - &raumfeld_rotary_property_set); 1066 + device_add_properties(&rotary_encoder_device.dev, 1067 + raumfeld_rotary_properties); 1064 1068 platform_device_register(&rotary_encoder_device); 1065 1069 1066 1070 spi_register_board_info(ARRAY_AND_SIZE(controller_spi_devices)); ··· 1099 1103 platform_device_register(&smc91x_device); 1100 1104 1101 1105 gpiod_add_lookup_table(&raumfeld_rotary_gpios_table); 1102 - device_add_property_set(&rotary_encoder_device.dev, 1103 - &raumfeld_rotary_property_set); 1106 + device_add_properties(&rotary_encoder_device.dev, 1107 + raumfeld_rotary_properties); 1104 1108 platform_device_register(&rotary_encoder_device); 1105 1109 1106 1110 raumfeld_audio_init();
+1 -5
arch/arm/mach-tegra/board-paz00.c
··· 29 29 { }, 30 30 }; 31 31 32 - static struct property_set __initdata wifi_rfkill_pset = { 33 - .properties = wifi_rfkill_prop, 34 - }; 35 - 36 32 static struct platform_device wifi_rfkill_device = { 37 33 .name = "rfkill_gpio", 38 34 .id = -1, ··· 45 49 46 50 void __init tegra_paz00_wifikill_init(void) 47 51 { 48 - platform_device_add_properties(&wifi_rfkill_device, &wifi_rfkill_pset); 52 + platform_device_add_properties(&wifi_rfkill_device, wifi_rfkill_prop); 49 53 gpiod_add_lookup_table(&wifi_gpio_lookup); 50 54 platform_device_register(&wifi_rfkill_device); 51 55 }
+10 -9
drivers/base/platform.c
··· 322 322 /** 323 323 * platform_device_add_properties - add built-in properties to a platform device 324 324 * @pdev: platform device to add properties to 325 - * @pset: properties to add 325 + * @properties: null terminated array of properties to add 326 326 * 327 - * The function will take deep copy of the properties in @pset and attach 328 - * the copy to the platform device. The memory associated with properties 329 - * will be freed when the platform device is released. 327 + * The function will take deep copy of @properties and attach the copy to the 328 + * platform device. The memory associated with properties will be freed when the 329 + * platform device is released. 330 330 */ 331 331 int platform_device_add_properties(struct platform_device *pdev, 332 - const struct property_set *pset) 332 + struct property_entry *properties) 333 333 { 334 - return device_add_property_set(&pdev->dev, pset); 334 + return device_add_properties(&pdev->dev, properties); 335 335 } 336 336 EXPORT_SYMBOL_GPL(platform_device_add_properties); 337 337 ··· 447 447 release_resource(r); 448 448 } 449 449 450 - device_remove_property_set(&pdev->dev); 450 + device_remove_properties(&pdev->dev); 451 451 } 452 452 } 453 453 EXPORT_SYMBOL_GPL(platform_device_del); ··· 526 526 if (ret) 527 527 goto err; 528 528 529 - if (pdevinfo->pset) { 530 - ret = platform_device_add_properties(pdev, pdevinfo->pset); 529 + if (pdevinfo->properties) { 530 + ret = platform_device_add_properties(pdev, 531 + pdevinfo->properties); 531 532 if (ret) 532 533 goto err; 533 534 }
+21 -13
drivers/base/property.c
··· 19 19 #include <linux/etherdevice.h> 20 20 #include <linux/phy.h> 21 21 22 + struct property_set { 23 + struct fwnode_handle fwnode; 24 + struct property_entry *properties; 25 + }; 26 + 22 27 static inline bool is_pset_node(struct fwnode_handle *fwnode) 23 28 { 24 29 return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_PDATA; ··· 806 801 } 807 802 808 803 /** 809 - * device_remove_property_set - Remove properties from a device object. 804 + * device_remove_properties - Remove properties from a device object. 810 805 * @dev: Device whose properties to remove. 811 806 * 812 807 * The function removes properties previously associated to the device 813 - * secondary firmware node with device_add_property_set(). Memory allocated 808 + * secondary firmware node with device_add_properties(). Memory allocated 814 809 * to the properties will also be released. 815 810 */ 816 - void device_remove_property_set(struct device *dev) 811 + void device_remove_properties(struct device *dev) 817 812 { 818 813 struct fwnode_handle *fwnode; 819 814 ··· 836 831 } 837 832 } 838 833 } 839 - EXPORT_SYMBOL_GPL(device_remove_property_set); 834 + EXPORT_SYMBOL_GPL(device_remove_properties); 840 835 841 836 /** 842 - * device_add_property_set - Add a collection of properties to a device object. 837 + * device_add_properties - Add a collection of properties to a device object. 843 838 * @dev: Device to add properties to. 844 - * @pset: Collection of properties to add. 839 + * @properties: Collection of properties to add. 845 840 * 846 - * Associate a collection of device properties represented by @pset with @dev 847 - * as its secondary firmware node. The function takes a copy of @pset. 841 + * Associate a collection of device properties represented by @properties with 842 + * @dev as its secondary firmware node. The function takes a copy of 843 + * @properties. 848 844 */ 849 - int device_add_property_set(struct device *dev, const struct property_set *pset) 845 + int device_add_properties(struct device *dev, struct property_entry *properties) 850 846 { 851 - struct property_set *p; 847 + struct property_set *p, pset; 852 848 853 - if (!pset) 849 + if (!properties) 854 850 return -EINVAL; 855 851 856 - p = pset_copy_set(pset); 852 + pset.properties = properties; 853 + 854 + p = pset_copy_set(&pset); 857 855 if (IS_ERR(p)) 858 856 return PTR_ERR(p); 859 857 ··· 864 856 set_secondary_fwnode(dev, &p->fwnode); 865 857 return 0; 866 858 } 867 - EXPORT_SYMBOL_GPL(device_add_property_set); 859 + EXPORT_SYMBOL_GPL(device_add_properties); 868 860 869 861 /** 870 862 * device_get_next_child_node - Return the next child node handle for a device
+2 -10
drivers/mfd/intel-lpss-acpi.c
··· 31 31 { }, 32 32 }; 33 33 34 - static struct property_set spt_i2c_pset = { 35 - .properties = spt_i2c_properties, 36 - }; 37 - 38 34 static const struct intel_lpss_platform_info spt_i2c_info = { 39 35 .clk_rate = 120000000, 40 - .pset = &spt_i2c_pset, 36 + .properties = spt_i2c_properties, 41 37 }; 42 38 43 39 static const struct intel_lpss_platform_info bxt_info = { ··· 47 51 { }, 48 52 }; 49 53 50 - static struct property_set bxt_i2c_pset = { 51 - .properties = bxt_i2c_properties, 52 - }; 53 - 54 54 static const struct intel_lpss_platform_info bxt_i2c_info = { 55 55 .clk_rate = 133000000, 56 - .pset = &bxt_i2c_pset, 56 + .properties = bxt_i2c_properties, 57 57 }; 58 58 59 59 static const struct acpi_device_id intel_lpss_acpi_ids[] = {
+4 -16
drivers/mfd/intel-lpss-pci.c
··· 71 71 { }, 72 72 }; 73 73 74 - static struct property_set spt_i2c_pset = { 75 - .properties = spt_i2c_properties, 76 - }; 77 - 78 74 static const struct intel_lpss_platform_info spt_i2c_info = { 79 75 .clk_rate = 120000000, 80 - .pset = &spt_i2c_pset, 76 + .properties = spt_i2c_properties, 81 77 }; 82 78 83 79 static struct property_entry uart_properties[] = { ··· 83 87 { }, 84 88 }; 85 89 86 - static struct property_set uart_pset = { 87 - .properties = uart_properties, 88 - }; 89 - 90 90 static const struct intel_lpss_platform_info spt_uart_info = { 91 91 .clk_rate = 120000000, 92 92 .clk_con_id = "baudclk", 93 - .pset = &uart_pset, 93 + .properties = uart_properties, 94 94 }; 95 95 96 96 static const struct intel_lpss_platform_info bxt_info = { ··· 96 104 static const struct intel_lpss_platform_info bxt_uart_info = { 97 105 .clk_rate = 100000000, 98 106 .clk_con_id = "baudclk", 99 - .pset = &uart_pset, 107 + .properties = uart_properties, 100 108 }; 101 109 102 110 static struct property_entry bxt_i2c_properties[] = { ··· 106 114 { }, 107 115 }; 108 116 109 - static struct property_set bxt_i2c_pset = { 110 - .properties = bxt_i2c_properties, 111 - }; 112 - 113 117 static const struct intel_lpss_platform_info bxt_i2c_info = { 114 118 .clk_rate = 133000000, 115 - .pset = &bxt_i2c_pset, 119 + .properties = bxt_i2c_properties, 116 120 }; 117 121 118 122 static const struct pci_device_id intel_lpss_pci_ids[] = {
+1 -1
drivers/mfd/intel-lpss.c
··· 407 407 if (ret) 408 408 return ret; 409 409 410 - lpss->cell->pset = info->pset; 410 + lpss->cell->properties = info->properties; 411 411 412 412 intel_lpss_init_dev(lpss); 413 413
+2 -2
drivers/mfd/intel-lpss.h
··· 16 16 17 17 struct device; 18 18 struct resource; 19 - struct property_set; 19 + struct property_entry; 20 20 21 21 struct intel_lpss_platform_info { 22 22 struct resource *mem; 23 23 int irq; 24 24 unsigned long clk_rate; 25 25 const char *clk_con_id; 26 - struct property_set *pset; 26 + struct property_entry *properties; 27 27 }; 28 28 29 29 int intel_lpss_probe(struct device *dev,
+2 -2
drivers/mfd/mfd-core.c
··· 193 193 goto fail_alias; 194 194 } 195 195 196 - if (cell->pset) { 197 - ret = platform_device_add_properties(pdev, cell->pset); 196 + if (cell->properties) { 197 + ret = platform_device_add_properties(pdev, cell->properties); 198 198 if (ret) 199 199 goto fail_alias; 200 200 }
+2 -2
include/linux/mfd/core.h
··· 17 17 #include <linux/platform_device.h> 18 18 19 19 struct irq_domain; 20 - struct property_set; 20 + struct property_entry; 21 21 22 22 /* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */ 23 23 struct mfd_cell_acpi_match { ··· 47 47 size_t pdata_size; 48 48 49 49 /* device properties passed to the sub devices drivers */ 50 - const struct property_set *pset; 50 + struct property_entry *properties; 51 51 52 52 /* 53 53 * Device Tree compatible string
+3 -3
include/linux/platform_device.h
··· 18 18 #define PLATFORM_DEVID_AUTO (-2) 19 19 20 20 struct mfd_cell; 21 - struct property_set; 21 + struct property_entry; 22 22 23 23 struct platform_device { 24 24 const char *name; ··· 73 73 size_t size_data; 74 74 u64 dma_mask; 75 75 76 - const struct property_set *pset; 76 + struct property_entry *properties; 77 77 }; 78 78 extern struct platform_device *platform_device_register_full( 79 79 const struct platform_device_info *pdevinfo); ··· 172 172 extern int platform_device_add_data(struct platform_device *pdev, 173 173 const void *data, size_t size); 174 174 extern int platform_device_add_properties(struct platform_device *pdev, 175 - const struct property_set *pset); 175 + struct property_entry *properties); 176 176 extern int platform_device_add(struct platform_device *pdev); 177 177 extern void platform_device_del(struct platform_device *pdev); 178 178 extern void platform_device_put(struct platform_device *pdev);
+3 -12
include/linux/property.h
··· 238 238 .name = _name_, \ 239 239 } 240 240 241 - /** 242 - * struct property_set - Collection of "built-in" device properties. 243 - * @fwnode: Handle to be pointed to by the fwnode field of struct device. 244 - * @properties: Array of properties terminated with a null entry. 245 - */ 246 - struct property_set { 247 - struct fwnode_handle fwnode; 248 - struct property_entry *properties; 249 - }; 250 - 251 - int device_add_property_set(struct device *dev, const struct property_set *pset); 252 - void device_remove_property_set(struct device *dev); 241 + int device_add_properties(struct device *dev, 242 + struct property_entry *properties); 243 + void device_remove_properties(struct device *dev); 253 244 254 245 bool device_dma_supported(struct device *dev); 255 246