From gregkh at linuxfoundation.org Tue Jul 1 21:59:12 2025 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Tue, 1 Jul 2025 13:59:12 +0200 Subject: [PATCH] fsi: make cdx_bus_type constant Message-ID: <2025070111-magma-scheme-313d@gregkh> Now that the driver core can properly handle constant struct bus_type, move the fsi_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Eddie James Cc: Ninad Palsule Cc: linux-fsi at lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman --- drivers/fsi/fsi-core.c | 2 +- include/linux/fsi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 50e8736039fe..ee39d1699387 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -1404,7 +1404,7 @@ void fsi_driver_unregister(struct fsi_driver *fsi_drv) } EXPORT_SYMBOL_GPL(fsi_driver_unregister); -struct bus_type fsi_bus_type = { +const struct bus_type fsi_bus_type = { .name = "fsi", .match = fsi_bus_match, }; diff --git a/include/linux/fsi.h b/include/linux/fsi.h index 8c5eef808788..adea1b432f2d 100644 --- a/include/linux/fsi.h +++ b/include/linux/fsi.h @@ -68,7 +68,7 @@ extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr, extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr, const void *val, size_t size); -extern struct bus_type fsi_bus_type; +extern const struct bus_type fsi_bus_type; extern const struct device_type fsi_cdev_type; enum fsi_dev_type { -- 2.50.0 From gregkh at linuxfoundation.org Tue Jul 1 22:05:06 2025 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Tue, 1 Jul 2025 14:05:06 +0200 Subject: [PATCH] fsi: make cdx_bus_type constant In-Reply-To: <2025070111-magma-scheme-313d@gregkh> References: <2025070111-magma-scheme-313d@gregkh> Message-ID: <2025070156-babble-moodiness-fbf7@gregkh> On Tue, Jul 01, 2025 at 01:59:12PM +0200, Greg Kroah-Hartman wrote: > Now that the driver core can properly handle constant struct bus_type, > move the fsi_bus_type variable to be a constant structure as well, > placing it into read-only memory which can not be modified at runtime. Got the subject wrong, let me go fix up... From gregkh at linuxfoundation.org Tue Jul 1 22:07:01 2025 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Tue, 1 Jul 2025 14:07:01 +0200 Subject: [PATCH v2] fsi: make fsi_bus_type constant Message-ID: <2025070100-overblown-busily-a04b@gregkh> Now that the driver core can properly handle constant struct bus_type, move the fsi_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Eddie James Cc: Ninad Palsule Cc: linux-fsi at lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman --- v2: fix up subject line to be correct drivers/fsi/fsi-core.c | 2 +- include/linux/fsi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 50e8736039fe..ee39d1699387 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -1404,7 +1404,7 @@ void fsi_driver_unregister(struct fsi_driver *fsi_drv) } EXPORT_SYMBOL_GPL(fsi_driver_unregister); -struct bus_type fsi_bus_type = { +const struct bus_type fsi_bus_type = { .name = "fsi", .match = fsi_bus_match, }; diff --git a/include/linux/fsi.h b/include/linux/fsi.h index 8c5eef808788..adea1b432f2d 100644 --- a/include/linux/fsi.h +++ b/include/linux/fsi.h @@ -68,7 +68,7 @@ extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr, extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr, const void *val, size_t size); -extern struct bus_type fsi_bus_type; +extern const struct bus_type fsi_bus_type; extern const struct device_type fsi_cdev_type; enum fsi_dev_type { -- 2.50.0 From robh at kernel.org Fri Jul 4 04:34:38 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Thu, 3 Jul 2025 13:34:38 -0500 Subject: [PATCH] fsi: master-ast-cf: Use of_reserved_mem_region_to_resource for "memory-region" Message-ID: <20250703183439.2073555-1-robh@kernel.org> Use the newly added of_reserved_mem_region_to_resource() function to handle "memory-region" properties. Signed-off-by: Rob Herring (Arm) --- drivers/fsi/fsi-master-ast-cf.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/fsi/fsi-master-ast-cf.c b/drivers/fsi/fsi-master-ast-cf.c index 9f2fd444ceb6..e67d7cd30fca 100644 --- a/drivers/fsi/fsi-master-ast-cf.c +++ b/drivers/fsi/fsi-master-ast-cf.c @@ -13,13 +13,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include "fsi-master.h" @@ -1285,14 +1285,7 @@ static int fsi_master_acf_probe(struct platform_device *pdev) master->gpio_mux = gpio; /* Grab the reserved memory region (use DMA API instead ?) */ - np = of_parse_phandle(mnode, "memory-region", 0); - if (!np) { - dev_err(&pdev->dev, "Didn't find reserved memory\n"); - rc = -EINVAL; - goto err_free; - } - rc = of_address_to_resource(np, 0, &res); - of_node_put(np); + rc = of_reserved_mem_region_to_resource(mnode, 0, &res); if (rc) { dev_err(&pdev->dev, "Couldn't address to resource for reserved memory\n"); rc = -ENOMEM; -- 2.47.2