pinctrl: samsung: Remove messages for failed memory allocation
Memory subsystem already prints message about failed memory allocation, there is no need to do it in the drivers. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
9d7b1f28c1
commit
fa5c0f46e2
|
@ -517,10 +517,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
|
||||||
|
|
||||||
weint_data = devm_kzalloc(dev, bank->nr_pins
|
weint_data = devm_kzalloc(dev, bank->nr_pins
|
||||||
* sizeof(*weint_data), GFP_KERNEL);
|
* sizeof(*weint_data), GFP_KERNEL);
|
||||||
if (!weint_data) {
|
if (!weint_data)
|
||||||
dev_err(dev, "could not allocate memory for weint_data\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
for (idx = 0; idx < bank->nr_pins; ++idx) {
|
for (idx = 0; idx < bank->nr_pins; ++idx) {
|
||||||
irq = irq_of_parse_and_map(bank->of_node, idx);
|
irq = irq_of_parse_and_map(bank->of_node, idx);
|
||||||
|
@ -548,10 +546,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
|
||||||
|
|
||||||
muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
|
muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
|
||||||
+ muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
|
+ muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
|
||||||
if (!muxed_data) {
|
if (!muxed_data)
|
||||||
dev_err(dev, "could not allocate memory for muxed_data\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
irq_set_chained_handler_and_data(irq, exynos_irq_demux_eint16_31,
|
irq_set_chained_handler_and_data(irq, exynos_irq_demux_eint16_31,
|
||||||
muxed_data);
|
muxed_data);
|
||||||
|
|
|
@ -489,10 +489,8 @@ static int s3c64xx_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
|
||||||
|
|
||||||
data = devm_kzalloc(dev, sizeof(*data)
|
data = devm_kzalloc(dev, sizeof(*data)
|
||||||
+ nr_domains * sizeof(*data->domains), GFP_KERNEL);
|
+ nr_domains * sizeof(*data->domains), GFP_KERNEL);
|
||||||
if (!data) {
|
if (!data)
|
||||||
dev_err(dev, "failed to allocate handler data\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
data->drvdata = d;
|
data->drvdata = d;
|
||||||
|
|
||||||
bank = d->pin_banks;
|
bank = d->pin_banks;
|
||||||
|
@ -715,10 +713,8 @@ static int s3c64xx_eint_eint0_init(struct samsung_pinctrl_drv_data *d)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
|
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
|
||||||
if (!data) {
|
if (!data)
|
||||||
dev_err(dev, "could not allocate memory for wkup eint data\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
data->drvdata = d;
|
data->drvdata = d;
|
||||||
|
|
||||||
for (i = 0; i < NUM_EINT0_IRQ; ++i) {
|
for (i = 0; i < NUM_EINT0_IRQ; ++i) {
|
||||||
|
@ -751,10 +747,8 @@ static int s3c64xx_eint_eint0_init(struct samsung_pinctrl_drv_data *d)
|
||||||
|
|
||||||
ddata = devm_kzalloc(dev,
|
ddata = devm_kzalloc(dev,
|
||||||
sizeof(*ddata) + nr_eints, GFP_KERNEL);
|
sizeof(*ddata) + nr_eints, GFP_KERNEL);
|
||||||
if (!ddata) {
|
if (!ddata)
|
||||||
dev_err(dev, "failed to allocate domain data\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
ddata->bank = bank;
|
ddata->bank = bank;
|
||||||
|
|
||||||
bank->irq_domain = irq_domain_add_linear(bank->of_node,
|
bank->irq_domain = irq_domain_add_linear(bank->of_node,
|
||||||
|
|
|
@ -93,10 +93,8 @@ static int reserve_map(struct device *dev, struct pinctrl_map **map,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
new_map = krealloc(*map, sizeof(*new_map) * new_num, GFP_KERNEL);
|
new_map = krealloc(*map, sizeof(*new_map) * new_num, GFP_KERNEL);
|
||||||
if (!new_map) {
|
if (!new_map)
|
||||||
dev_err(dev, "krealloc(map) failed\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
memset(new_map + old_num, 0, (new_num - old_num) * sizeof(*new_map));
|
memset(new_map + old_num, 0, (new_num - old_num) * sizeof(*new_map));
|
||||||
|
|
||||||
|
@ -133,10 +131,8 @@ static int add_map_configs(struct device *dev, struct pinctrl_map **map,
|
||||||
|
|
||||||
dup_configs = kmemdup(configs, num_configs * sizeof(*dup_configs),
|
dup_configs = kmemdup(configs, num_configs * sizeof(*dup_configs),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!dup_configs) {
|
if (!dup_configs)
|
||||||
dev_err(dev, "kmemdup(configs) failed\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
(*map)[*num_maps].type = PIN_MAP_TYPE_CONFIGS_GROUP;
|
(*map)[*num_maps].type = PIN_MAP_TYPE_CONFIGS_GROUP;
|
||||||
(*map)[*num_maps].data.configs.group_or_pin = group;
|
(*map)[*num_maps].data.configs.group_or_pin = group;
|
||||||
|
@ -156,10 +152,8 @@ static int add_config(struct device *dev, unsigned long **configs,
|
||||||
|
|
||||||
new_configs = krealloc(*configs, sizeof(*new_configs) * new_num,
|
new_configs = krealloc(*configs, sizeof(*new_configs) * new_num,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!new_configs) {
|
if (!new_configs)
|
||||||
dev_err(dev, "krealloc(configs) failed\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
new_configs[old_num] = config;
|
new_configs[old_num] = config;
|
||||||
|
|
||||||
|
@ -756,10 +750,8 @@ static struct samsung_pmx_func *samsung_pinctrl_create_functions(
|
||||||
|
|
||||||
functions = devm_kzalloc(dev, func_cnt * sizeof(*functions),
|
functions = devm_kzalloc(dev, func_cnt * sizeof(*functions),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!functions) {
|
if (!functions)
|
||||||
dev_err(dev, "failed to allocate memory for function list\n");
|
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
|
||||||
func = functions;
|
func = functions;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -850,10 +842,8 @@ static int samsung_pinctrl_register(struct platform_device *pdev,
|
||||||
|
|
||||||
pindesc = devm_kzalloc(&pdev->dev, sizeof(*pindesc) *
|
pindesc = devm_kzalloc(&pdev->dev, sizeof(*pindesc) *
|
||||||
drvdata->nr_pins, GFP_KERNEL);
|
drvdata->nr_pins, GFP_KERNEL);
|
||||||
if (!pindesc) {
|
if (!pindesc)
|
||||||
dev_err(&pdev->dev, "mem alloc for pin descriptors failed\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
ctrldesc->pins = pindesc;
|
ctrldesc->pins = pindesc;
|
||||||
ctrldesc->npins = drvdata->nr_pins;
|
ctrldesc->npins = drvdata->nr_pins;
|
||||||
|
|
||||||
|
@ -867,10 +857,8 @@ static int samsung_pinctrl_register(struct platform_device *pdev,
|
||||||
*/
|
*/
|
||||||
pin_names = devm_kzalloc(&pdev->dev, sizeof(char) * PIN_NAME_LENGTH *
|
pin_names = devm_kzalloc(&pdev->dev, sizeof(char) * PIN_NAME_LENGTH *
|
||||||
drvdata->nr_pins, GFP_KERNEL);
|
drvdata->nr_pins, GFP_KERNEL);
|
||||||
if (!pin_names) {
|
if (!pin_names)
|
||||||
dev_err(&pdev->dev, "mem alloc for pin names failed\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
/* for each pin, the name of the pin is pin-bank name + pin number */
|
/* for each pin, the name of the pin is pin-bank name + pin number */
|
||||||
for (bank = 0; bank < drvdata->nr_banks; bank++) {
|
for (bank = 0; bank < drvdata->nr_banks; bank++) {
|
||||||
|
|
Loading…
Reference in New Issue