[PATCH 1/4] drm/dsi: Make mipi_dsi_dcs_write() return ssize_t

Thierry Reding thierry.reding at gmail.com
Wed Jul 23 00:27:45 PDT 2014


On Tue, Jul 22, 2014 at 12:23:07PM +0200, Andrzej Hajda wrote:
> Hi Thierry,
> 
> YoungJun's comment refreshed my memory about mipi_dsi_dcs_write return
> value. It should be rather int than ssize_t. Why?
> .transfer() returns the number of read bytes or error, but in case
> of dcs write no bytes are read, so it in fact returns error or 0.
> This is why return value was implemented originally as int.
> So I do not think this patch is necessary.

I think it should return the number of bytes written or an error. That
way we give callers the maximum amount of information. They may still
choose to only handle < 0 for convenience, but at least the information
will be there should it become required at some point.

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/20140723/f21ff5ac/attachment.sig>


More information about the dri-devel mailing list