From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: Re: [PATCH 01/11] i2c: add helpers for locking the I2C segment Date: Mon, 18 Jun 2018 20:05:03 +0900 Message-ID: <20180618110502.cb5s24srp4frahm6@ninjato> References: <20180615101506.8012-1-peda@axentia.se> <20180615101506.8012-2-peda@axentia.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kyrdsz3663p2mr6a" Return-path: Content-Disposition: inline In-Reply-To: <20180615101506.8012-2-peda@axentia.se> Sender: linux-kernel-owner@vger.kernel.org To: Peter Rosin Cc: linux-kernel@vger.kernel.org, Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , Brian Norris , Gregory Fong , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Sekhar Nori , Kevin Hilman , Haavard Skinnemoen , Kukjin Kim , Krzysztof Kozlowski , Orson Zhai , Baolin Wang , Chunyan Zhang , Laxman Dewangan , Thierry Reding List-Id: linux-input@vger.kernel.org --kyrdsz3663p2mr6a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > +static inline void > +i2c_lock_segment(struct i2c_adapter *adapter) > +{ > + i2c_lock_bus(adapter, I2C_LOCK_SEGMENT); > +} > + > +static inline int > +i2c_trylock_segment(struct i2c_adapter *adapter) > +{ > + return i2c_trylock_bus(adapter, I2C_LOCK_SEGMENT); > +} > + > +static inline void > +i2c_unlock_segment(struct i2c_adapter *adapter) > +{ > + i2c_unlock_bus(adapter, I2C_LOCK_SEGMENT); > +} I wonder if i2c_lock_segment() and i2c_lock_root_adapter() are really more readable and convenient than i2c_lock_bus() with the flag. I think the flags have speaking names, too. Is that an idea to remove these functions altogether and start using i2c_lock_bus()? --kyrdsz3663p2mr6a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAlsnkdkACgkQFA3kzBSg KbYHrxAAq5XQSNo6hQGYuXMRkA7MybJvlJqw3Pp8w2csvX2JO0CFIq3RA1WcHkav nQZKZTByfrB/oCh+La6HhIy59XgmyetlSLo3u+VQ5YinF3XK6JBKfeImWuLUS706 vRiptpAMjjaW2SbGJ3NOalr3mgcZ9ru1j4lhN9yq3iBMvWv7uzDAUMmMRtaNNqWx aWtIdaWozAyGdKiRh7fhaP0uZXGGC4JDxurrgNE1tGPqkNAMSTD+rGvgEux+A/z3 nO2UTLmQf/UYDv50FJAFsrl6magReFxyLV7WrJz+wj3l3UyzMEYmGEW3i/j0MZ6A WkfLGPpYHEXeX6HRbDE2p6gCuTpWyXBbLBV3fyvSJ6/2qqGnEIxk08Si0XmGwHJi Y+t63nhtVzVE2HmU0KssJBKa4C86/bROyDEgkTsq3fijA8ec3i3RtMAgB0DmQat3 WiACufPjP+n36+IgtKn7UzzaqfuRwUVB788O+E4CI+AVHNTN7maHyBjyTB8Sx/cX k5p2FzxEVlVnsANHTL6Mhw4GfZLMP6ofU5MrIEiKIAX53QSOwvg7EoXXu4skUbgv JjPqOsqSQOR755iXJ/al/sJCQYnMvpWmTqTgFnqq19jHkLO4bczEa6AoTZlD1XRN b2aWYQrXXSKySuOB/X1BqGdfw5Kals3WHGOB7/bVf9LKhSaLUsc= =uT/j -----END PGP SIGNATURE----- --kyrdsz3663p2mr6a--