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

Dan Williams
2022-11-23T19:23:55Z

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@kernel.dk>
> Cc: Alison Schofield <alison.schofield@intel.com>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Ben Widawsky <bwidawsk@kernel.org>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Jeremy Kerr <jk@ozlabs.org>
> Cc: Joel Stanley <joel@jms.id.au>
> Cc: Alistar Popple <alistair@popple.id.au>
> Cc: Eddie James <eajames@linux.ibm.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Jilin Yuan <yuanjilin@cdjrlc.com>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> Cc: Won Chung <wonchung@google.com>
> Cc: linux-block@vger.kernel.org
> Cc: linux-cxl@vger.kernel.org
> Cc: linux-fsi@lists.ozlabs.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@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@intel.com>