From: Darius <augulis.darius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mark Brown
<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: Guennadi Liakhovetski
<g.liakhovetski-Mmb7MZpHnFY@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] i2c: Platform data is optional for i2c-imx
Date: Mon, 12 Jan 2009 15:54:48 +0200 [thread overview]
Message-ID: <496B4BA8.1010801@gmail.com> (raw)
In-Reply-To: <1231771521-3772-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Mark Brown wrote:
> The i.MX i2c driver insists on platform data but all the fields may be
> omitted individually so remove the requirement for platform data.
>
Hi Mark,
if it's ok for all other guys, I will make changes and send refreshed
patch to ML.
Darius.
> Signed-off-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
> ---
>
> This is an incremental patch against the (still out of tree) i.MX
> driver. Is there anything that can be done to help with getting that
> mainlined?
>
> drivers/i2c/busses/i2c-imx.c | 12 ++++--------
> 1 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 3296380..2028ab8 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -457,12 +457,8 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
> }
>
> pdata = pdev->dev.platform_data;
> - if (!pdata) {
> - dev_err(&pdev->dev, "I2C driver needs platform data\n");
> - return -ENODEV;
> - }
>
> - if (pdata->init) {
> + if (pdata && pdata->init) {
> ret = pdata->init(&pdev->dev);
> if (ret)
> return ret;
> @@ -516,7 +512,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
> i2c_set_adapdata(&i2c_imx->adapter, i2c_imx);
>
> /* Set up clock divider */
> - if (pdata->bitrate)
> + if (pdata && pdata->bitrate)
> i2c_imx_set_clk(i2c_imx, pdata->bitrate);
> else
> i2c_imx_set_clk(i2c_imx, IMX_I2C_BIT_RATE);
> @@ -556,7 +552,7 @@ fail2:
> fail1:
> iounmap(base);
> fail0:
> - if (pdata->exit)
> + if (pdata && pdata->exit)
> pdata->exit(&pdev->dev);
> return ret; /* Return error number */
> }
> @@ -581,7 +577,7 @@ static int __exit i2c_imx_remove(struct platform_device *pdev)
> writeb(0, i2c_imx->base + IMX_I2C_I2SR);
>
> /* Shut down hardware */
> - if (pdata->exit)
> + if (pdata && pdata->exit)
> pdata->exit(&pdev->dev);
>
> /* Disable I2C clock */
>
prev parent reply other threads:[~2009-01-12 13:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-08 10:08 [PATCH v2] iMX/MXC support for I2C Darius
[not found] ` <493CF201.8030406-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-12-08 10:15 ` Darius
[not found] ` <493CF3D5.7010706-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-12-16 21:14 ` Ben Dooks
2008-12-16 21:34 ` Ben Dooks
[not found] ` <20081216213455.GC8032-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2009-01-12 14:29 ` Darius
2009-01-12 14:45 ` [PATCH] i2c: Platform data is optional for i2c-imx Mark Brown
[not found] ` <1231771521-3772-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2009-01-12 13:54 ` Darius [this message]
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=496B4BA8.1010801@gmail.com \
--to=augulis.darius-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=g.liakhovetski-Mmb7MZpHnFY@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.