diff options
Diffstat (limited to 'drivers/opp')
| -rw-r--r-- | drivers/opp/core.c | 12 | ||||
| -rw-r--r-- | drivers/opp/cpu.c | 2 | ||||
| -rw-r--r-- | drivers/opp/of.c | 5 | ||||
| -rw-r--r-- | drivers/opp/ti-opp-supply.c | 3 |
4 files changed, 10 insertions, 12 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c index ae43c656f108..a109d4dd5316 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1532,7 +1532,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index) * Allocate a new OPP table. In the infrequent case where a new * device is needed to be added, we pay this penalty. */ - opp_table = kzalloc(sizeof(*opp_table), GFP_KERNEL); + opp_table = kzalloc_obj(*opp_table, GFP_KERNEL); if (!opp_table) return ERR_PTR(-ENOMEM); @@ -2260,9 +2260,8 @@ static int _opp_set_regulators(struct opp_table *opp_table, struct device *dev, if (opp_table->regulators) return 0; - opp_table->regulators = kmalloc_array(count, - sizeof(*opp_table->regulators), - GFP_KERNEL); + opp_table->regulators = kmalloc_objs(*opp_table->regulators, count, + GFP_KERNEL); if (!opp_table->regulators) return -ENOMEM; @@ -2364,8 +2363,7 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev, if (opp_table->clks) return 0; - opp_table->clks = kmalloc_array(count, sizeof(*opp_table->clks), - GFP_KERNEL); + opp_table->clks = kmalloc_objs(*opp_table->clks, count, GFP_KERNEL); if (!opp_table->clks) return -ENOMEM; @@ -2550,7 +2548,7 @@ int dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config) unsigned int id; int ret; - data = kmalloc(sizeof(*data), GFP_KERNEL); + data = kmalloc_obj(*data, GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/opp/cpu.c b/drivers/opp/cpu.c index a6da7ee3ec76..9ea7c323a8b9 100644 --- a/drivers/opp/cpu.c +++ b/drivers/opp/cpu.c @@ -51,7 +51,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, if (max_opps <= 0) return max_opps ? max_opps : -ENODATA; - freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_KERNEL); + freq_table = kzalloc_objs(*freq_table, (max_opps + 1), GFP_KERNEL); if (!freq_table) return -ENOMEM; diff --git a/drivers/opp/of.c b/drivers/opp/of.c index a268c2b250c0..a6e16f406289 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -303,7 +303,8 @@ static int _of_opp_alloc_required_opps(struct opp_table *opp_table, if (!count) return 0; - opp->required_opps = kcalloc(count, sizeof(*opp->required_opps), GFP_KERNEL); + opp->required_opps = kzalloc_objs(*opp->required_opps, count, + GFP_KERNEL); if (!opp->required_opps) return -ENOMEM; @@ -469,7 +470,7 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev, } num_paths = count / 2; - paths = kcalloc(num_paths, sizeof(*paths), GFP_KERNEL); + paths = kzalloc_objs(*paths, num_paths, GFP_KERNEL); if (!paths) return -ENOMEM; diff --git a/drivers/opp/ti-opp-supply.c b/drivers/opp/ti-opp-supply.c index 5f0fb3ea385b..b4281f85415b 100644 --- a/drivers/opp/ti-opp-supply.c +++ b/drivers/opp/ti-opp-supply.c @@ -127,8 +127,7 @@ static int _store_optimized_voltages(struct device *dev, goto out; } - table = kcalloc(data->num_vdd_table, sizeof(*data->vdd_table), - GFP_KERNEL); + table = kzalloc_objs(*data->vdd_table, data->num_vdd_table, GFP_KERNEL); if (!table) { ret = -ENOMEM; goto out; |
