coresight: stm: return error code instead of zero in .packet()
authorChunyan Zhang <zhang.chunyan@linaro.org>
Fri, 9 Sep 2016 10:18:09 +0000 (18:18 +0800)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Fri, 9 Sep 2016 15:34:12 +0000 (09:34 -0600)
commit6015bb25e7b390b28a33caeee97c4e6288c4bcc7
tree7347e6586dc1b2640bf25a40cac7955ac1b70eac
parenta559985c4a80c4bac6c10f0ba010d58e766090a9
coresight: stm: return error code instead of zero in .packet()

In STM framework driver, the trace data writing loop would keep running
until it received a negative return value or the whole trace packet has
been written to STM device.  So if the .packet() of STM device always
returns zero since the device is not enabled or the parameter isn't
supported, STM framework driver will stall into a dead loop.

Returning -EACCES (Permission denied) in .packet() if the device is
disabled makes more sense, and this is the same for returning -EINVAL
if the channel passed into is not supported.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/hwtracing/coresight/coresight-stm.c
This page took 0.028967 seconds and 5 git commands to generate.