-
- Downloads
driver core: have match() callback in struct bus_type take a const *
In the match() callback, the struct device_driver * should not be changed, so change the function callback to be a const *. This is one step of many towards making the driver core safe to have struct device_driver in read-only memory. Because the match() callback is in all busses, all busses are modified to handle this properly. This does entail switching some container_of() calls to container_of_const() to properly handle the constant *. For some busses, like PCI and USB and HV, the const * is cast away in the match callback as those busses do want to modify those structures at this point in time (they have a local lock in the driver structure.) That will have to be changed in the future if they wish to have their struct device * in read-only-memory. Cc: Rafael J. Wysocki <rafael@kernel.org> Reviewed-by:Alex Elder <elder@kernel.org> Acked-by:
Sumit Garg <sumit.garg@linaro.org> Link: https://lore.kernel.org/r/2024070136-wrongdoer-busily-01e8@gregkh Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
- arch/arm/common/locomo.c 2 additions, 2 deletionsarch/arm/common/locomo.c
- arch/arm/include/asm/hardware/locomo.h 1 addition, 1 deletionarch/arm/include/asm/hardware/locomo.h
- arch/parisc/include/asm/parisc-device.h 1 addition, 1 deletionarch/parisc/include/asm/parisc-device.h
- arch/parisc/kernel/drivers.c 2 additions, 2 deletionsarch/parisc/kernel/drivers.c
- arch/powerpc/include/asm/ps3.h 1 addition, 5 deletionsarch/powerpc/include/asm/ps3.h
- arch/powerpc/include/asm/vio.h 1 addition, 5 deletionsarch/powerpc/include/asm/vio.h
- arch/powerpc/platforms/ps3/system-bus.c 2 additions, 2 deletionsarch/powerpc/platforms/ps3/system-bus.c
- arch/powerpc/platforms/pseries/ibmebus.c 1 addition, 1 deletionarch/powerpc/platforms/pseries/ibmebus.c
- arch/powerpc/platforms/pseries/vio.c 3 additions, 3 deletionsarch/powerpc/platforms/pseries/vio.c
- arch/s390/include/asm/ccwdev.h 1 addition, 1 deletionarch/s390/include/asm/ccwdev.h
- arch/sparc/include/asm/vio.h 1 addition, 5 deletionsarch/sparc/include/asm/vio.h
- arch/sparc/kernel/vio.c 2 additions, 2 deletionsarch/sparc/kernel/vio.c
- drivers/acpi/bus.c 2 additions, 2 deletionsdrivers/acpi/bus.c
- drivers/amba/bus.c 3 additions, 3 deletionsdrivers/amba/bus.c
- drivers/base/auxiliary.c 1 addition, 1 deletiondrivers/base/auxiliary.c
- drivers/base/base.h 1 addition, 2 deletionsdrivers/base/base.h
- drivers/base/cpu.c 1 addition, 1 deletiondrivers/base/cpu.c
- drivers/base/isa.c 1 addition, 1 deletiondrivers/base/isa.c
- drivers/base/platform.c 1 addition, 1 deletiondrivers/base/platform.c
- drivers/bcma/main.c 3 additions, 3 deletionsdrivers/bcma/main.c
Loading
Please register or sign in to comment