From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [RFC PATCH] drm/dp: let drivers specify the name of the I2C-over-AUX adapter Date: Mon, 10 Mar 2014 13:32:29 +0100 Message-ID: <20140310123228.GB26681@ulmo.nvidia.com> References: <1394020227-16738-1-git-send-email-jani.nikula@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0248547051==" Return-path: In-Reply-To: <1394020227-16738-1-git-send-email-jani.nikula@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: Jani Nikula Cc: intel-gfx@lists.freedesktop.org, Thierry Reding , dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0248547051== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gatW/ieO32f1wygP" Content-Disposition: inline --gatW/ieO32f1wygP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 05, 2014 at 01:50:27PM +0200, Jani Nikula wrote: [...] > I am not entirely happy with adding an extra name field, but I also > didn't like the caller having to set up aux.ddc.name in advance. Ideas > welcome. What you propose is a whole lot better than having to modify the internals of struct i2c_adapter in advance, and I can't think of a better alternative either. I have two small comments below. > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_hel= per.c > index 35251af3b14e..17832d048147 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -726,7 +726,8 @@ int drm_dp_aux_register_i2c_bus(struct drm_dp_aux *au= x) > aux->ddc.dev.parent =3D aux->dev; > aux->ddc.dev.of_node =3D aux->dev->of_node; > =20 > - strncpy(aux->ddc.name, dev_name(aux->dev), sizeof(aux->ddc.name)); > + strlcpy(aux->ddc.name, aux->name ? aux->name : dev_name(aux->dev), > + sizeof(aux->ddc.name)); I don't see why the change from strncpy() to strlcpy() would be necessary. > diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h [...] > @@ -438,6 +438,9 @@ struct drm_dp_aux_msg { > * The .dev field should be set to a pointer to the device that implemen= ts > * the AUX channel. > * > + * The .name field may be used to specify the name of the I2C adapter. I= f set to > + * NULL, dev_name() of .dev will be used. > + * Nit: That new paragraph sticks out because it's wider than the rest, even though it still fits into 80 characters. I don't feel all that strongly about either of the above, so: Reviewed-by: Thierry Reding --gatW/ieO32f1wygP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTHbDcAAoJEN0jrNd/PrOhyicP/2BmaB3AddlQoM/9u8zQaNrl kbTUtz939UeXq0nAShry2wIUz8F4bejrJ6cKkeiTcLtU/vyPme2patRvpOLXy3em uB6fP4IWF9ERmnnZ4JDAeqUYRr3SgTQ3R5p8pBINEyfOysAFNlJpdj4kUQSXAcvQ s+Unzi4luKheryP4/AjLxRzAqKyDNw2wp5PrbBRC5sLovEMni/WpYUo1rt57k+K1 O05enUcwrRyKFb3eNmKK2lAjh8iBsARWEj5S2ZW1JfZ95q0HSzhJKLEvIZkCX829 M/EN1YdKGLmiTRkDM3+iWfQUc4st2nA0injiyvE1s0+2QC3wIj34zaTHgKp7R1ad SB/6K0cGQWb5g0AXKrbJzEzOl5nHQ3Av1dSqudPpoq7cGSIHd9ez31zfe1HyiVxd TYBSoulhx24PG4gPIjVSdWCbDiOUUNUoMU/X4IGqkKIIJEhYbi0dBz3OGaa8Sz7C nje9vuHtfKQFsAgs3XvcJp3EZrpcbdeBYWXIUbvG9YSkuF8DPjpysCJgdyryo1aX tNfBGP9Pp5Xi8iM5K+T8Dw4o9j2cnrbHyjMioscrpLj8XwluCxRmkZ7B5xWOO1YJ MeIvS/5rkCJGX/XAumkq+n1wTVsbKr8pOBmGTNn2F+12143UOfpMMnV5eB4/XrFV rtSdoooyXGuP1D5+l2Xz =iK4z -----END PGP SIGNATURE----- --gatW/ieO32f1wygP-- --===============0248547051== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0248547051==--