driver core: fix up some missing class.devnode() conversions.
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Nov 2022 17:35:39 +0000 (18:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2022 08:28:46 +0000 (09:28 +0100)
In commit ff62b8e6588f ("driver core: make struct class.devnode() take a
const *") the ->devnode callback changed the pointer to be const, but a
few instances of PowerPC drivers were not caught for some reason.

Fix this up by changing the pointers to be const.

Fixes: ff62b8e6588f ("driver core: make struct class.devnode() take a const *")
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Frederic Barrat <fbarrat@linux.ibm.com>
Cc: Andrew Donnellan <ajd@linux.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@lists.ozlabs.org
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/r/20221128173539.3112234-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/platforms/book3s/vas-api.c
drivers/misc/cxl/file.c
drivers/misc/ocxl/file.c

index 40f5ae5..eb5bed3 100644 (file)
@@ -53,7 +53,7 @@ struct coproc_instance {
        struct vas_window *txwin;
 };
 
-static char *coproc_devnode(struct device *dev, umode_t *mode)
+static char *coproc_devnode(const struct device *dev, umode_t *mode)
 {
        return kasprintf(GFP_KERNEL, "crypto/%s", dev_name(dev));
 }
index 3dbdce9..5878329 100644 (file)
@@ -546,7 +546,7 @@ static const struct file_operations afu_master_fops = {
 };
 
 
-static char *cxl_devnode(struct device *dev, umode_t *mode)
+static char *cxl_devnode(const struct device *dev, umode_t *mode)
 {
        if (cpu_has_feature(CPU_FTR_HVMODE) &&
            CXL_DEVT_IS_CARD(dev->devt)) {
index d46dba2..d96be36 100644 (file)
@@ -581,7 +581,7 @@ void ocxl_file_unregister_afu(struct ocxl_afu *afu)
        device_unregister(&info->dev);
 }
 
-static char *ocxl_devnode(struct device *dev, umode_t *mode)
+static char *ocxl_devnode(const struct device *dev, umode_t *mode)
 {
        return kasprintf(GFP_KERNEL, "ocxl/%s", dev_name(dev));
 }