All the other error paths about invalid results or unsupported
operations return EINVAL, so remove the only instance of ENOTSUP.
Since the API documentation makes no promises on the actual negative
value of the returned error, this little change of behavior should be
fine.
if (h.packet_type != AM7XXX_PACKET_TYPE_DEVINFO) {
error(dev->ctx, "expected packet type: %d, got %d instead!\n",
AM7XXX_PACKET_TYPE_DEVINFO, h.packet_type);
- errno = ENOTSUP;
- return -ENOTSUP;
+ errno = EINVAL;
+ return -EINVAL;
}
dev->device_info = malloc(sizeof(*dev->device_info));