device property: don't bother the drivers with struct property_set
Since device_add_property_set() now always takes a copy of the property_set, and also since the fwnode type is always hard coded to be FWNODE_PDATA, there is no need for the drivers to deliver the entire struct property_set. The function can just create the instance of it on its own and bind the properties from the drivers to it on the spot. This renames device_add_property_set() to device_add_properties(). The function now takes struct property_entry as its parameter instead of struct property_set. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tento commit je obsažen v:

odevzdal
Rafael J. Wysocki

rodič
9735a22799
revize
f4d0526603
@@ -31,13 +31,9 @@ static struct property_entry spt_i2c_properties[] = {
|
||||
{ },
|
||||
};
|
||||
|
||||
static struct property_set spt_i2c_pset = {
|
||||
.properties = spt_i2c_properties,
|
||||
};
|
||||
|
||||
static const struct intel_lpss_platform_info spt_i2c_info = {
|
||||
.clk_rate = 120000000,
|
||||
.pset = &spt_i2c_pset,
|
||||
.properties = spt_i2c_properties,
|
||||
};
|
||||
|
||||
static const struct intel_lpss_platform_info bxt_info = {
|
||||
@@ -51,13 +47,9 @@ static struct property_entry bxt_i2c_properties[] = {
|
||||
{ },
|
||||
};
|
||||
|
||||
static struct property_set bxt_i2c_pset = {
|
||||
.properties = bxt_i2c_properties,
|
||||
};
|
||||
|
||||
static const struct intel_lpss_platform_info bxt_i2c_info = {
|
||||
.clk_rate = 133000000,
|
||||
.pset = &bxt_i2c_pset,
|
||||
.properties = bxt_i2c_properties,
|
||||
};
|
||||
|
||||
static const struct acpi_device_id intel_lpss_acpi_ids[] = {
|
||||
|
@@ -71,13 +71,9 @@ static struct property_entry spt_i2c_properties[] = {
|
||||
{ },
|
||||
};
|
||||
|
||||
static struct property_set spt_i2c_pset = {
|
||||
.properties = spt_i2c_properties,
|
||||
};
|
||||
|
||||
static const struct intel_lpss_platform_info spt_i2c_info = {
|
||||
.clk_rate = 120000000,
|
||||
.pset = &spt_i2c_pset,
|
||||
.properties = spt_i2c_properties,
|
||||
};
|
||||
|
||||
static struct property_entry uart_properties[] = {
|
||||
@@ -87,14 +83,10 @@ static struct property_entry uart_properties[] = {
|
||||
{ },
|
||||
};
|
||||
|
||||
static struct property_set uart_pset = {
|
||||
.properties = uart_properties,
|
||||
};
|
||||
|
||||
static const struct intel_lpss_platform_info spt_uart_info = {
|
||||
.clk_rate = 120000000,
|
||||
.clk_con_id = "baudclk",
|
||||
.pset = &uart_pset,
|
||||
.properties = uart_properties,
|
||||
};
|
||||
|
||||
static const struct intel_lpss_platform_info bxt_info = {
|
||||
@@ -104,7 +96,7 @@ static const struct intel_lpss_platform_info bxt_info = {
|
||||
static const struct intel_lpss_platform_info bxt_uart_info = {
|
||||
.clk_rate = 100000000,
|
||||
.clk_con_id = "baudclk",
|
||||
.pset = &uart_pset,
|
||||
.properties = uart_properties,
|
||||
};
|
||||
|
||||
static struct property_entry bxt_i2c_properties[] = {
|
||||
@@ -114,13 +106,9 @@ static struct property_entry bxt_i2c_properties[] = {
|
||||
{ },
|
||||
};
|
||||
|
||||
static struct property_set bxt_i2c_pset = {
|
||||
.properties = bxt_i2c_properties,
|
||||
};
|
||||
|
||||
static const struct intel_lpss_platform_info bxt_i2c_info = {
|
||||
.clk_rate = 133000000,
|
||||
.pset = &bxt_i2c_pset,
|
||||
.properties = bxt_i2c_properties,
|
||||
};
|
||||
|
||||
static const struct pci_device_id intel_lpss_pci_ids[] = {
|
||||
|
@@ -407,7 +407,7 @@ int intel_lpss_probe(struct device *dev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
lpss->cell->pset = info->pset;
|
||||
lpss->cell->properties = info->properties;
|
||||
|
||||
intel_lpss_init_dev(lpss);
|
||||
|
||||
|
@@ -16,14 +16,14 @@
|
||||
|
||||
struct device;
|
||||
struct resource;
|
||||
struct property_set;
|
||||
struct property_entry;
|
||||
|
||||
struct intel_lpss_platform_info {
|
||||
struct resource *mem;
|
||||
int irq;
|
||||
unsigned long clk_rate;
|
||||
const char *clk_con_id;
|
||||
struct property_set *pset;
|
||||
struct property_entry *properties;
|
||||
};
|
||||
|
||||
int intel_lpss_probe(struct device *dev,
|
||||
|
@@ -193,8 +193,8 @@ static int mfd_add_device(struct device *parent, int id,
|
||||
goto fail_alias;
|
||||
}
|
||||
|
||||
if (cell->pset) {
|
||||
ret = platform_device_add_properties(pdev, cell->pset);
|
||||
if (cell->properties) {
|
||||
ret = platform_device_add_properties(pdev, cell->properties);
|
||||
if (ret)
|
||||
goto fail_alias;
|
||||
}
|
||||
|
Odkázat v novém úkolu
Zablokovat Uživatele