|
@@ -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) {
|
|
|
|
- dev_err(dev, "krealloc(map) failed\n");
|
|
|
|
|
|
+ if (!new_map)
|
|
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) {
|
|
|
|
- dev_err(dev, "kmemdup(configs) failed\n");
|
|
|
|
|
|
+ if (!dup_configs)
|
|
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) {
|
|
|
|
- dev_err(dev, "krealloc(configs) failed\n");
|
|
|
|
|
|
+ if (!new_configs)
|
|
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) {
|
|
|
|
- dev_err(dev, "failed to allocate memory for function list\n");
|
|
|
|
|
|
+ if (!functions)
|
|
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) {
|
|
|
|
- dev_err(&pdev->dev, "mem alloc for pin descriptors failed\n");
|
|
|
|
|
|
+ if (!pindesc)
|
|
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) {
|
|
|
|
- dev_err(&pdev->dev, "mem alloc for pin names failed\n");
|
|
|
|
|
|
+ if (!pin_names)
|
|
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++) {
|