gpio: htc-egpio: remove redundant error message
There's no need to emit an error message on probe failure unless we're printing some meaningful info. Otherwise the core driver code will inform us about a probe error. Also: the driver currently drops info about errors propagated from called functions by default to returning -EINVAL. This fixes it as well. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
1135ee4af7
commit
a02712e1eb
@ -265,7 +265,6 @@ static int __init egpio_probe(struct platform_device *pdev)
|
|||||||
struct gpio_chip *chip;
|
struct gpio_chip *chip;
|
||||||
unsigned int irq, irq_end;
|
unsigned int irq, irq_end;
|
||||||
int i;
|
int i;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Initialize ei data structure. */
|
/* Initialize ei data structure. */
|
||||||
ei = devm_kzalloc(&pdev->dev, sizeof(*ei), GFP_KERNEL);
|
ei = devm_kzalloc(&pdev->dev, sizeof(*ei), GFP_KERNEL);
|
||||||
@ -275,7 +274,6 @@ static int __init egpio_probe(struct platform_device *pdev)
|
|||||||
spin_lock_init(&ei->lock);
|
spin_lock_init(&ei->lock);
|
||||||
|
|
||||||
/* Find chained irq */
|
/* Find chained irq */
|
||||||
ret = -EINVAL;
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||||
if (res)
|
if (res)
|
||||||
ei->chained_irq = res->start;
|
ei->chained_irq = res->start;
|
||||||
@ -283,15 +281,17 @@ static int __init egpio_probe(struct platform_device *pdev)
|
|||||||
/* Map egpio chip into virtual address space. */
|
/* Map egpio chip into virtual address space. */
|
||||||
ei->base_addr = devm_platform_ioremap_resource(pdev, 0);
|
ei->base_addr = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (IS_ERR(ei->base_addr))
|
if (IS_ERR(ei->base_addr))
|
||||||
goto fail;
|
return PTR_ERR(ei->base_addr);
|
||||||
|
|
||||||
if ((pdata->bus_width != 16) && (pdata->bus_width != 32))
|
if ((pdata->bus_width != 16) && (pdata->bus_width != 32))
|
||||||
goto fail;
|
return -EINVAL;
|
||||||
|
|
||||||
ei->bus_shift = fls(pdata->bus_width - 1) - 3;
|
ei->bus_shift = fls(pdata->bus_width - 1) - 3;
|
||||||
pr_debug("bus_shift = %d\n", ei->bus_shift);
|
pr_debug("bus_shift = %d\n", ei->bus_shift);
|
||||||
|
|
||||||
if ((pdata->reg_width != 8) && (pdata->reg_width != 16))
|
if ((pdata->reg_width != 8) && (pdata->reg_width != 16))
|
||||||
goto fail;
|
return -EINVAL;
|
||||||
|
|
||||||
ei->reg_shift = fls(pdata->reg_width - 1);
|
ei->reg_shift = fls(pdata->reg_width - 1);
|
||||||
pr_debug("reg_shift = %d\n", ei->reg_shift);
|
pr_debug("reg_shift = %d\n", ei->reg_shift);
|
||||||
|
|
||||||
@ -303,10 +303,9 @@ static int __init egpio_probe(struct platform_device *pdev)
|
|||||||
ei->chip = devm_kcalloc(&pdev->dev,
|
ei->chip = devm_kcalloc(&pdev->dev,
|
||||||
ei->nchips, sizeof(struct egpio_chip),
|
ei->nchips, sizeof(struct egpio_chip),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!ei->chip) {
|
if (!ei->chip)
|
||||||
ret = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
for (i = 0; i < ei->nchips; i++) {
|
for (i = 0; i < ei->nchips; i++) {
|
||||||
ei->chip[i].reg_start = pdata->chip[i].reg_start;
|
ei->chip[i].reg_start = pdata->chip[i].reg_start;
|
||||||
ei->chip[i].cached_values = pdata->chip[i].initial_values;
|
ei->chip[i].cached_values = pdata->chip[i].initial_values;
|
||||||
@ -316,10 +315,9 @@ static int __init egpio_probe(struct platform_device *pdev)
|
|||||||
chip->label = devm_kasprintf(&pdev->dev, GFP_KERNEL,
|
chip->label = devm_kasprintf(&pdev->dev, GFP_KERNEL,
|
||||||
"htc-egpio-%d",
|
"htc-egpio-%d",
|
||||||
i);
|
i);
|
||||||
if (!chip->label) {
|
if (!chip->label)
|
||||||
ret = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
chip->parent = &pdev->dev;
|
chip->parent = &pdev->dev;
|
||||||
chip->owner = THIS_MODULE;
|
chip->owner = THIS_MODULE;
|
||||||
chip->get = egpio_get;
|
chip->get = egpio_get;
|
||||||
@ -361,10 +359,6 @@ static int __init egpio_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
|
||||||
printk(KERN_ERR "EGPIO failed to setup\n");
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user