From: Vitja Makarov Date: Wed, 9 Apr 2008 00:41:57 +0000 (-0700) Subject: spi: spi_bfin5xx: fix probe() sequencing X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f9e522caece074b9a985436d611127e8e96ad446;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git spi: spi_bfin5xx: fix probe() sequencing Fix bug in SPI probe: first initialize peripheral pins, and just after register spi master device. This fixes problems with SPI drivers built-in kernel. Singed-off-by: Vitja Makarov Signed-off-by: Bryan Wu Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index c93c9d6d52e9..a4bf3af7a157 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c @@ -1294,6 +1294,12 @@ static int __init bfin5xx_spi_probe(struct platform_device *pdev) goto out_error_queue_alloc; } + status = peripheral_request_list(drv_data->pin_req, DRV_NAME); + if (status != 0) { + dev_err(&pdev->dev, ": Requesting Peripherals failed\n"); + goto out_error_queue_alloc; + } + /* Register with the SPI framework */ platform_set_drvdata(pdev, drv_data); status = spi_register_master(master); @@ -1302,12 +1308,6 @@ static int __init bfin5xx_spi_probe(struct platform_device *pdev) goto out_error_queue_alloc; } - status = peripheral_request_list(drv_data->pin_req, DRV_NAME); - if (status != 0) { - dev_err(&pdev->dev, ": Requesting Peripherals failed\n"); - goto out_error; - } - dev_info(dev, "%s, Version %s, regs_base@%p, dma channel@%d\n", DRV_DESC, DRV_VERSION, drv_data->regs_base, drv_data->dma_channel);