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

From: Greg Kroah-Hartman
Date: Wed Jan 11 2023 - 04:50:26 EST


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@xxxxxxxxxxxxxxx>
>
> (see one nit-pick below)
>
> > Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
> > Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > Cc: Jason Gunthorpe <jgg@xxxxxxxx>
> > Cc: Ira Weiny <ira.weiny@xxxxxxxxx>
> > Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
> > Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > Cc: Won Chung <wonchung@xxxxxxxxxx>
> > Cc: linux-kernel@xxxxxxxxxxxxxxx
> > Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > ---
> > 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