Re: linux-next: build failure after merge of the driver-core tree

Greg KH
2022-11-30T12:02:11Z

On Wed, Nov 30, 2022 at 12:38:51PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the driver-core tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> drivers/scsi/cxlflash/main.c: In function 'cxlflash_class_init':
> drivers/scsi/cxlflash/main.c:3890:33: error: assignment to 'char * (*)(const struct device *, umode_t *)' {aka 'char * (*)(const struct device *, short unsigned int *)'} from incompatible pointer type 'char * (*)(struct device *, umode_t *)' {aka 'char * (*)(struct device *, short unsigned int *)'} [-Werror=incompatible-pointer-types]
> 3890 | cxlflash_class->devnode = cxlflash_devnode;
> | ^
>
> Caused by commit
>
> ff62b8e6588f ("driver core: make struct class.devnode() take a const *")
>
> I have applied the following patch for today (please add it to your tree).
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Wed, 30 Nov 2022 12:13:00 +1100
> Subject: [PATCH] driver core: fix up missed scsi/cxlflash class.devnode() conversion.
>
> Fixes: ff62b8e6588f ("driver core: make struct class.devnode() take a const *")
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> drivers/scsi/cxlflash/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
> index cd1324ec742d..395b00b942f7 100644
> --- a/drivers/scsi/cxlflash/main.c
> +++ b/drivers/scsi/cxlflash/main.c
> @@ -3857,7 +3857,7 @@ static void cxlflash_pci_resume(struct pci_dev *pdev)
> *
> * Return: Allocated string describing the devtmpfs structure.
> */
> -static char *cxlflash_devnode(struct device *dev, umode_t *mode)
> +static char *cxlflash_devnode(const struct device *dev, umode_t *mode)
> {
> return kasprintf(GFP_KERNEL, "cxlflash/%s", dev_name(dev));
> }
> --
> 2.35.1
>
> I also added the following (found using
> git grep '(struct device\s*\*[^,]*,\s*umode_t[^,]*)'
> - please also add this):
>

Both now queued up, thanks.

greg k-h