remoteproc: xlnx: remove binding header dependency
PATCH 1/1 remoteproc: xlnx: remove binding header dependency
Bindings can be deprecated and driver should not include bindings headers directly. Instead define needed constants in the driver.
--- drivers/remoteproc/xlnx_r5_remoteproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +5 -1
@@ -4,7 +4,6 @@* */ -#include <dt-bindings/power/xlnx-zynqmp-power.h> #include <linux/dma-mapping.h> #include <linux/firmware/xlnx-zynqmp.h> #include <linux/kernel.h>
@@ -19,6 +18,11 @@#include "remoteproc_internal.h" +#define PD_R5_0_ATCM 15 +#define PD_R5_0_BTCM 16 +#define PD_R5_1_ATCM 17 +#define PD_R5_1_BTCM 18 +/* IPI buffer MAX length */ #define IPI_BUF_LEN_MAX 32U
base-commit: 54dacf6efe7196c1cd8ae4b5c691579d0510a8bd
Signature · 1 line
2.34.1
Mathieu Poirier
maintainerQuoted 3 lines · Tanmay Shah
Bindings can be deprecated and driver should not include bindings headers directly. Instead define needed constants in the driver.
Is there an official directive about not including bindings in drivers? To me it seems advantageous to have a focal point for the definition of constants, guaranteeing eveyone uses the same values.
Quoted 34 lines
Signed-off-by Tanmay Shah <[email protected]>--- drivers/remoteproc/xlnx_r5_remoteproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/remoteproc/xlnx_r5_remoteproc.c +5
-1@@ -4,7 +4,6 @@* */ -#include <dt-bindings/power/xlnx-zynqmp-power.h> #include <linux/dma-mapping.h> #include <linux/firmware/xlnx-zynqmp.h> #include <linux/kernel.h> @@ -19,6 +18,11 @@#include "remoteproc_internal.h" +#define PD_R5_0_ATCM 15 +#define PD_R5_0_BTCM 16 +#define PD_R5_1_ATCM 17 +#define PD_R5_1_BTCM 18 +/* IPI buffer MAX length */ #define IPI_BUF_LEN_MAX 32Ubase-commit:
54dacf6efe7196c1cd8ae4b5c691579d0510a8bdSignature · 1 line
2.34.1
Quoted 9 lines · Mathieu Poirier
Quoted 3 lines · Tanmay Shah
Bindings can be deprecated and driver should not include bindings headers directly. Instead define needed constants in the driver.
Is there an official directive about not including bindings in drivers? To me it seems advantageous to have a focal point for the definition of constants, guaranteeing eveyone uses the same values.
This is what I found from here:
https://docs.kernel.org/process/maintainer-soc.html
2.3.2. Driver Branch Dependencies
"Avoid defining custom macros in include/dt-bindings/ for hardware constants that can be derived from a datasheet -- binding macros in header files should only be used as a last resort if there is no natural way to define a binding"
Also, bindings can be deprecated, so if the current binding gets deprecated, the header file can be removed from the include/dt-bindings.
Quoted 34 lines
Quoted 34 lines
Signed-off-by Tanmay Shah <[email protected]>--- drivers/remoteproc/xlnx_r5_remoteproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/remoteproc/xlnx_r5_remoteproc.c +5
-1@@ -4,7 +4,6 @@* */ -#include <dt-bindings/power/xlnx-zynqmp-power.h> #include <linux/dma-mapping.h> #include <linux/firmware/xlnx-zynqmp.h> #include <linux/kernel.h> @@ -19,6 +18,11 @@#include "remoteproc_internal.h" +#define PD_R5_0_ATCM 15 +#define PD_R5_0_BTCM 16 +#define PD_R5_1_ATCM 17 +#define PD_R5_1_BTCM 18 +/* IPI buffer MAX length */ #define IPI_BUF_LEN_MAX 32Ubase-commit:
54dacf6efe7196c1cd8ae4b5c691579d0510a8bdSignature · 1 line
2.34.1
Mathieu Poirier
maintainerQuoted 19 lines · Tanmay
Quoted 9 lines · Mathieu Poirier
Quoted 3 lines · Tanmay Shah
Bindings can be deprecated and driver should not include bindings headers directly. Instead define needed constants in the driver.
Is there an official directive about not including bindings in drivers? To me it seems advantageous to have a focal point for the definition of constants, guaranteeing eveyone uses the same values.
This is what I found from here:
https://docs.kernel.org/process/maintainer-soc.html2.3.2. Driver Branch Dependencies
Quoted 8 lines
"Avoid defining custom macros in
include/dt-bindings/for hardware constants that can be derived from a datasheet -- binding macros in header files should only be used as a last resort if there is no natural way to define a binding"Also, bindings can be deprecated, so if the current binding gets deprecated, the header file can be removed from the
include/dt-bindings.
Fair enough. I'll apply your patch tomorrow.
Quoted 35 lines
Quoted 34 lines
Quoted 34 lines
Signed-off-by Tanmay Shah <[email protected]>--- drivers/remoteproc/xlnx_r5_remoteproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/remoteproc/xlnx_r5_remoteproc.c +5
-1@@ -4,7 +4,6 @@* */ -#include <dt-bindings/power/xlnx-zynqmp-power.h> #include <linux/dma-mapping.h> #include <linux/firmware/xlnx-zynqmp.h> #include <linux/kernel.h> @@ -19,6 +18,11 @@#include "remoteproc_internal.h" +#define PD_R5_0_ATCM 15 +#define PD_R5_0_BTCM 16 +#define PD_R5_1_ATCM 17 +#define PD_R5_1_BTCM 18 +/* IPI buffer MAX length */ #define IPI_BUF_LEN_MAX 32Ubase-commit:
54dacf6efe7196c1cd8ae4b5c691579d0510a8bd--
2.34.1