From: Nuno Sa Date: Tue, 9 Jul 2024 11:14:29 +0000 (+0200) Subject: iio: backend: print message in case op is not implemented X-Git-Tag: v6.12-rc1~39^2~37^2~161 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd97cdd520ed678036fd154b852da50a90496cee;p=thirdparty%2Fkernel%2Flinux.git iio: backend: print message in case op is not implemented For APIs that have a return value, -EOPNOTSUPP is returned in case the backend does not support the functionality. However, for APIs that do not have a return value we are left in silence. Hence, at least print a debug message in case the callback is not implemented by the backend. Signed-off-by: Nuno Sa Link: https://patch.msgid.link/20240709-dev-iio-backend-add-debugfs-v1-2-fb4b8f2373c7@analog.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c index 65a42944d0904..f9da635cdfeaf 100644 --- a/drivers/iio/industrialio-backend.c +++ b/drivers/iio/industrialio-backend.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -111,6 +112,9 @@ static DEFINE_MUTEX(iio_back_lock); __ret = iio_backend_check_op(__back, op); \ if (!__ret) \ __back->ops->op(__back, ##args); \ + else \ + dev_dbg(__back->dev, "Op(%s) not implemented\n",\ + __stringify(op)); \ } /**