Re: [PATCH 5/5] driver core: device_get_devnode() should take a const *

Greg Kroah-Hartman
2023-01-11T09:50:25Z

On Wed, Nov 23, 2022 at 03:36:37PM +0200, Andy Shevchenko wrote:
> On Wed, Nov 23, 2022 at 01:25:23PM +0100, Greg Kroah-Hartman wrote:
> > device_get_devnode() should take a constant * to struct device as it
> > does not modify it in any way, so modify the function definition to do
> > this and move it out of device.h as it does not need to be exposed to
> > the whole kernel tree.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> (see one nit-pick below)
>
> > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > Cc: Ira Weiny <ira.weiny@intel.com>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Cc: Won Chung <wonchung@google.com>
> > Cc: linux-kernel@vger.kernel.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> > drivers/base/base.h | 2 ++
> > drivers/base/core.c | 2 +-
> > include/linux/device.h | 2 --
> > 3 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/base/base.h b/drivers/base/base.h
> > index 7d4803c03d3e..a8a119c36bdc 100644
> > --- a/drivers/base/base.h
> > +++ b/drivers/base/base.h
> > @@ -158,6 +158,8 @@ extern void device_block_probing(void);
> > extern void device_unblock_probing(void);
> > extern void deferred_probe_extend_timeout(void);
> > extern void driver_deferred_probe_trigger(void);
>
> I would put a blank line here if the below doesn't belong to the deferral probe
> routines.

This whole .h file needs to be cleaned up and made nicer (the externs
show it's age), so I'll just leave this as-is and when all of the rework
is done reorginize it.

thanks for the review!

greg k-h