Re: [PATCH] i2c: rockchip: Replace driver from kernel repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 |




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux