From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Wolfram Sang <wsa@the-dreams.de>,
Sascha Hauer <s.hauer@pengutronix.de>,
linux-i2c@vger.kernel.org,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <fabio.estevam@nxp.com>,
Shawn Guo <shawnguo@kernel.org>,
linux-arm-kernel@lists.infradead.org,
NXP Linux Team <linux-imx@nxp.com>
Subject: Re: [PATCH v3 1/1] i2c: imx: refactor error handling on i2c_imx_dma_request()
Date: Fri, 30 Nov 2018 10:52:38 +0100 [thread overview]
Message-ID: <20181130095238.z736hvdeibouqu2b@pengutronix.de> (raw)
In-Reply-To: <20181130094418.17700-1-o.rempel@pengutronix.de>
On Fri, Nov 30, 2018 at 10:44:18AM +0100, Oleksij Rempel wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> Current implementation will print error if system is not configured
> with DMA for I2C core. At least on i.MX5x variants is DMA event for I2C
> muxed with SDHC. So it is project specific configuration and not an error.
>
> This patch will also affect probe, since it will forward all error except
> of missing DMA.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> [ore: make it actually compile, fix a corner case]
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> changes:
> 20181130 v3:
> - reword commit message
> 20181112 v2:
> - drop "[PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and
> later" and rebase without this patch.
> - Set proper initial author
>
> drivers/i2c/busses/i2c-imx.c | 36 +++++++++++++++++++++---------------
> 1 file changed, 21 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index c406700789e1..3c12b174bbb1 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -273,7 +273,7 @@ static inline unsigned char imx_i2c_read_reg(struct imx_i2c_struct *i2c_imx,
> }
>
> /* Functions for DMA support */
> -static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
> +static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
> dma_addr_t phy_addr)
If you touch the line above, maybe also realign the followup line to
start at the opening parenthesis.
> {
> struct imx_i2c_dma *dma;
> @@ -283,11 +283,13 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
>
> dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL);
> if (!dma)
> - return;
> + return -ENOMEM;
>
> - dma->chan_tx = dma_request_slave_channel(dev, "tx");
> + dma->chan_tx = dma_request_chan(dev, "tx");
Maybe this is worth a separate change?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2018-11-30 9:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-30 9:44 [PATCH v3 1/1] i2c: imx: refactor error handling on i2c_imx_dma_request() Oleksij Rempel
2018-11-30 9:52 ` Uwe Kleine-König [this message]
2018-12-21 15:24 ` Uwe Kleine-König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181130095238.z736hvdeibouqu2b@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=fabio.estevam@nxp.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=o.rempel@pengutronix.de \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).