[PATCH 4/5] driver core: make struct device_type.devnode() take a const *

Dan Williams dan.j.williams at intel.com
Thu Nov 24 06:23:36 AEDT 2022


Greg Kroah-Hartman wrote:
> The devnode() callback in struct device_type should not be modifying the
> device that is passed into it, so mark it as a const * and propagate the
> function signature changes out into all relevant subsystems that use
> this callback.
> 
> Cc: Jens Axboe <axboe at kernel.dk>
> Cc: Alison Schofield <alison.schofield at intel.com>
> Cc: Vishal Verma <vishal.l.verma at intel.com>
> Cc: Ira Weiny <ira.weiny at intel.com>
> Cc: Ben Widawsky <bwidawsk at kernel.org>
> Cc: Dan Williams <dan.j.williams at intel.com>
> Cc: Jeremy Kerr <jk at ozlabs.org>
> Cc: Joel Stanley <joel at jms.id.au>
> Cc: Alistar Popple <alistair at popple.id.au>
> Cc: Eddie James <eajames at linux.ibm.com>
> Cc: Alexander Shishkin <alexander.shishkin at linux.intel.com>
> Cc: Jonathan Cameron <Jonathan.Cameron at huawei.com>
> Cc: Jilin Yuan <yuanjilin at cdjrlc.com>
> Cc: Heikki Krogerus <heikki.krogerus at linux.intel.com>
> Cc: Alan Stern <stern at rowland.harvard.edu>
> Cc: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> Cc: Thomas Gleixner <tglx at linutronix.de>
> Cc: Jason Gunthorpe <jgg at ziepe.ca>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki at intel.com>
> Cc: Won Chung <wonchung at google.com>
> Cc: linux-block at vger.kernel.org
> Cc: linux-cxl at vger.kernel.org
> Cc: linux-fsi at lists.ozlabs.org
> Cc: linux-kernel at vger.kernel.org
> Cc: linux-usb at vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
[..]
> diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
> index 20ce488a7754..6ae8d0bdc61b 100644
> --- a/drivers/cxl/core/memdev.c
> +++ b/drivers/cxl/core/memdev.c
> @@ -27,7 +27,7 @@ static void cxl_memdev_release(struct device *dev)
>  	kfree(cxlmd);
>  }
>  
> -static char *cxl_memdev_devnode(struct device *dev, umode_t *mode, kuid_t *uid,
> +static char *cxl_memdev_devnode(const struct device *dev, umode_t *mode, kuid_t *uid,
>  				kgid_t *gid)
>  {
>  	return kasprintf(GFP_KERNEL, "cxl/%s", dev_name(dev));

For the CXL bit:

Acked-by: Dan Williams <dan.j.williams at intel.com>


More information about the linux-fsi mailing list