Re: [PATCH v5 07/11] i2c: rtl9300: move setting SCL frequency to config_io

From: Sven Eckelmann
Date: Sun Aug 10 2025 - 04:55:02 EST


On Sunday, 10 August 2025 10:49:02 CEST Markus Elfring wrote:
>
> > +++ b/drivers/i2c/busses/i2c-rtl9300.c
>
> > +static int mshv_vtl_sint_ioctl_set_eventfd(struct mshv_vtl_set_eventfd __user *arg)
> > +{
>
> > @@ -244,7 +245,7 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
> >
> > mutex_lock(&i2c->lock);
> > if (chan->sda_num != i2c->sda_num) {
> > - ret = rtl9300_i2c_config_io(i2c, chan->sda_pin);
> > + ret = rtl9300_i2c_config_io(i2c, chan);
> > if (ret)
> > goto out_unlock;
>
>
> Under which circumstances would you become interested to apply a statement
> like “guard(mutex)(&i2c->lock);”?
> https://elixir.bootlin.com/linux/v6.16/source/include/linux/mutex.h#L225

https://lwn.net/Articles/934679/ ("From cleanup functions to classes")

Kind regards,
Sven

Attachment: signature.asc
Description: This is a digitally signed message part.