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

Andrzej Hajda a.hajda at samsung.com
Mon Oct 13 07:23:43 PDT 2014


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
};


Regards
Andrzej



More information about the dri-devel mailing list