mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 05:45:20 +00:00
spi: pxa2xx: Switch to use dev_err_probe()
Switch to use dev_err_probe() to simplify the error path and unify a message template. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240326181027.1418989-4-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
dad983d881
commit
d5449432f7
@ -1435,20 +1435,16 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
|
|||||||
platform_info = dev_get_platdata(dev);
|
platform_info = dev_get_platdata(dev);
|
||||||
if (!platform_info) {
|
if (!platform_info) {
|
||||||
platform_info = pxa2xx_spi_init_pdata(pdev);
|
platform_info = pxa2xx_spi_init_pdata(pdev);
|
||||||
if (IS_ERR(platform_info)) {
|
if (IS_ERR(platform_info))
|
||||||
dev_err(&pdev->dev, "missing platform data\n");
|
return dev_err_probe(dev, PTR_ERR(platform_info), "missing platform data\n");
|
||||||
return PTR_ERR(platform_info);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ssp = pxa_ssp_request(pdev->id, pdev->name);
|
ssp = pxa_ssp_request(pdev->id, pdev->name);
|
||||||
if (!ssp)
|
if (!ssp)
|
||||||
ssp = &platform_info->ssp;
|
ssp = &platform_info->ssp;
|
||||||
|
|
||||||
if (!ssp->mmio_base) {
|
if (!ssp->mmio_base)
|
||||||
dev_err(&pdev->dev, "failed to get SSP\n");
|
return dev_err_probe(dev, -ENODEV, "failed to get SSP\n");
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (platform_info->is_target)
|
if (platform_info->is_target)
|
||||||
controller = devm_spi_alloc_target(dev, sizeof(*drv_data));
|
controller = devm_spi_alloc_target(dev, sizeof(*drv_data));
|
||||||
@ -1456,8 +1452,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
|
|||||||
controller = devm_spi_alloc_host(dev, sizeof(*drv_data));
|
controller = devm_spi_alloc_host(dev, sizeof(*drv_data));
|
||||||
|
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
dev_err(&pdev->dev, "cannot alloc spi_controller\n");
|
status = dev_err_probe(dev, -ENOMEM, "cannot alloc spi_controller\n");
|
||||||
status = -ENOMEM;
|
|
||||||
goto out_error_controller_alloc;
|
goto out_error_controller_alloc;
|
||||||
}
|
}
|
||||||
drv_data = spi_controller_get_devdata(controller);
|
drv_data = spi_controller_get_devdata(controller);
|
||||||
@ -1511,7 +1506,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
|
|||||||
status = request_irq(ssp->irq, ssp_int, IRQF_SHARED, dev_name(dev),
|
status = request_irq(ssp->irq, ssp_int, IRQF_SHARED, dev_name(dev),
|
||||||
drv_data);
|
drv_data);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
dev_err(&pdev->dev, "cannot get IRQ %d\n", ssp->irq);
|
dev_err_probe(dev, status, "cannot get IRQ %d\n", ssp->irq);
|
||||||
goto out_error_controller_alloc;
|
goto out_error_controller_alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1627,7 +1622,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
|
|||||||
platform_set_drvdata(pdev, drv_data);
|
platform_set_drvdata(pdev, drv_data);
|
||||||
status = spi_register_controller(controller);
|
status = spi_register_controller(controller);
|
||||||
if (status) {
|
if (status) {
|
||||||
dev_err(&pdev->dev, "problem registering SPI controller\n");
|
dev_err_probe(dev, status, "problem registering SPI controller\n");
|
||||||
goto out_error_pm_runtime_enabled;
|
goto out_error_pm_runtime_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user