Re: [PATCH v3 3/4] gpio: imx-rpmsg: add imx-rpmsg GPIO driver
From: Shenwei Wang <shenwei.wang@nxp.com>
Date: 2025-10-13 18:41:15
Also in:
imx, linux-devicetree, linux-remoteproc, lkml
-----Original Message----- From: Andrew Lunn <andrew@lunn.ch> Sent: Monday, October 13, 2025 11:56 AM To: Shenwei Wang <shenwei.wang@nxp.com> Cc: Bjorn Andersson <andersson@kernel.org>; Mathieu Poirier [off-list ref]; Rob Herring [off-list ref]; Krzysztof Kozlowski [off-list ref]; Conor Dooley [off-list ref]; Shawn Guo [off-list ref]; Sascha Hauer [off-list ref]; Linus Walleij [off-list ref]; Bartosz Golaszewski [off-list ref]; Pengutronix Kernel Team [off-list ref]; Fabio Estevam [off-list ref]; Peng Fan [off-list ref]; linux- remoteproc@vger.kernel.org; devicetree@vger.kernel.org; imx@lists.linux.dev; linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; dl-linux-imx [off-list ref] Subject: [EXT] Re: [PATCH v3 3/4] gpio: imx-rpmsg: add imx-rpmsg GPIO driverquoted
quoted
Notice how ENOPNOTSUPP can be 45, 122, 223, or 95. Returning EL2NSYNC or EDQUOT to user space is going to cause confusion...quoted
I think we should just follow the definitions in include/uapi/asm-generic/errno.h, right?No. Try a make for mips, and look at includes you end up with. You will find it goes something like: # 1 "./arch/mips/include/asm/errno.h" 1 # 11 "./arch/mips/include/asm/errno.h" # 1 "./arch/mips/include/uapi/asm/errno.h" 1 # 16 "./arch/mips/include/uapi/asm/errno.h" # 1 "./include/uapi/asm-generic/errno-base.h" 1 # 17 "./arch/mips/include/uapi/asm/errno.h" 2 and this results in #define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */ not what you get from asm-generic/errno.h: #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
That shouldn't be an issue in this case. For instance, if we define the error code as 1 in the return message, the driver will interpret it and just return -EOPNOTSUPP, regardless of the architecture. Thanks, Shenwei
Andrew