[PATCH 03/15] drm/dsi: Add mipi_dsi_set_maximum_return_packet_size() helper

Thierry Reding thierry.reding at gmail.com
Tue Oct 14 02:31:14 PDT 2014


On Mon, Oct 13, 2014 at 04:23:43PM +0200, Andrzej Hajda wrote:
> On 10/13/2014 12:16 PM, Thierry Reding wrote:
> > +int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi,
> > +					    u16 value)
> > +{
> > +	u8 tx[2] = { value & 0xff, value >> 8 };
> > +	struct mipi_dsi_msg msg;
> > +	ssize_t err;
> > +
> > +	memset(&msg, 0, sizeof(msg));
> > +	msg.channel = dsi->channel;
> > +	msg.type = MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE;
> > +	msg.tx_len = sizeof(tx);
> > +	msg.tx_buf = tx;
> 
> One more thing, why do not use initializer:
> struct mipi_dsi_msg msg = {
> 	.channel = dsi->channel,
> 	.type = MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE,
> 	.tx_len = sizeof(tx),
> 	.tx_buf = tx
> };

Personal preference, that's all.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20141014/fd74bbf8/attachment.sig>


More information about the dri-devel mailing list