lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <jlmquzbwvzo3qau6xmyod3pysasqdqk622jkiaswd6v7k7z57t@alam3cwdqosm>
Date: Wed, 25 Sep 2024 11:35:03 +0200
From: Andi Shyti <andi.shyti@...nel.org>
To: Chris Packham <chris.packham@...iedtelesis.co.nz>
Cc: robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org, 
	tsbogend@...ha.franken.de, linux-i2c@...r.kernel.org, devicetree@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org
Subject: Re: [PATCH v3 2/3] i2c: Add driver for the RTL9300 I2C controller

Hi Chris,

...

> +enum rtl9300_bus_freq {
> +	RTL9300_I2C_STD_FREQ,
> +	RTL9300_I2C_FAST_FREQ,
> +};
> +
> +struct rtl9300_i2c;
> +
> +struct rtl9300_i2c_chan {
> +	struct i2c_adapter adap;
> +	struct rtl9300_i2c *i2c;
> +	enum rtl9300_bus_freq bus_freq;
> +	u8 sda_pin;
> +};
> +
> +#define RTL9300_I2C_MUX_NCHAN	8
> +
> +struct rtl9300_i2c {
> +	struct regmap *regmap;
> +	struct device *dev;
> +	struct rtl9300_i2c_chan chans[RTL9300_I2C_MUX_NCHAN];
> +	u32 reg_base;
> +	u8 sda_pin;
> +};

...

> +DEFINE_MUTEX(i2c_lock);

why is this lock defined here and not inside rtl9300_i2c?

...

> +static int rtl9300_i2c_execute_xfer(struct rtl9300_i2c *i2c, char read_write,
> +				int size, union i2c_smbus_data *data, int len)
> +{
> +	u32 val, mask;
> +	int ret;

...

> +static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
> +		  unsigned short flags, char read_write,
> +		  u8 command, int size, union i2c_smbus_data *data)

your alignments are a bit off.

A part from these two little notes, I don't see any issue here.

Thanks,
Andi

> +{
> +	struct rtl9300_i2c_chan *chan = i2c_get_adapdata(adap);
> +	struct rtl9300_i2c *i2c = chan->i2c;
> +	int len = 0, ret;

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ