From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Shiyan <eagle.alexander923@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] i2c: rockchip: Replace driver from kernel repository
Date: Fri, 7 Feb 2025 09:27:16 +0100 [thread overview]
Message-ID: <Z6XD5KGrSWnYBBXL@pengutronix.de> (raw)
In-Reply-To: <20250204132207.332918-1-eagle.alexander923@gmail.com>
Hi Alexander,
On Tue, Feb 04, 2025 at 04:22:07PM +0300, Alexander Shiyan wrote:
> +
> +static int rk3x_i2c_wait_xfer_poll(struct rk3x_i2c *i2c)
> +{
> + uint64_t start = get_time_ns();
> +
> + while (!is_timeout(start, WAIT_TIMEOUT)) {
> + rk3x_i2c_irq(i2c);
> + if (i2c->state == STATE_IDLE)
> + return 0;
> + udelay(5);
While it doesn't really hurt, this delay is unnecessary. We're busy
waiting anyway.
> + }
> +
> + return -ETIMEDOUT;
> +}
> +
> +static int rk3x_i2c_probe(struct device *dev)
> +{
> + struct device_node *np = dev->of_node;
> + struct rk3x_i2c_soc_data *data;
> + struct resource *iores;
> + unsigned long clk_rate;
> + struct rk3x_i2c *i2c;
> + int ret;
> +
> + i2c = xzalloc(sizeof(*i2c));
> + i2c->dev = dev;
> +
> + ret = dev_get_drvdata(dev, (const void **)&data);
> + if (ret < 0)
> + return dev_err_probe(dev, ret, "Failed to retrieve driver data\n");
This function is deprecated:
* DEPRECATED: use device_get_match_data instead, which avoids
* common pitfalls due to explicit pointer casts
I fixed these two things while applying.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2025-02-07 8:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 13:22 [PATCH] i2c: rockchip: Replace driver from kernel repository Alexander Shiyan
2025-02-07 8:25 ` Sascha Hauer
2025-02-07 8:27 ` Sascha Hauer [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=Z6XD5KGrSWnYBBXL@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=eagle.alexander923@gmail.com \
/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.