Re: [PATCH v3 1/1] i2c: imx: refactor error handling on i2c_imx_dma_request()
From: Uwe Kleine-König <hidden>
Date: 2018-12-21 15:25:08
Also in:
linux-i2c
Hello, On Fri, Nov 30, 2018 at 10:44:18AM +0100, Oleksij Rempel wrote:
quoted hunk ↗ jump to hunk
@@ -1159,11 +1163,13 @@ static int i2c_imx_probe(struct platform_device *pdev) dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n", res); dev_dbg(&i2c_imx->adapter.dev, "adapter name: \"%s\"\n", i2c_imx->adapter.name); - dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n"); /* Init DMA config if supported */ - i2c_imx_dma_request(i2c_imx, phy_addr); + ret = i2c_imx_dma_request(i2c_imx, phy_addr); + if (ret < 0) + goto clk_notifier_unregister;
Just found another problem while going over my mails: goto clk_notifier_unregister is wrong here as you have to undo i2c_add_numbered_adapter(). Probably it also makes sense to move initialisation of DMA before i2c_add_numbered_adapter() because otherwise the first transfer request might come in while i2c_imx_dma_request is in the middle of initializing the dma channels. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel