Skip to content

Commit c2a96b7

Browse files
committed
Merge tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH: "Here is the big set of driver core changes for 6.11-rc1. Lots of stuff in here, with not a huge diffstat, but apis are evolving which required lots of files to be touched. Highlights of the changes in here are: - platform remove callback api final fixups (Uwe took many releases to get here, finally!) - Rust bindings for basic firmware apis and initial driver-core interactions. It's not all that useful for a "write a whole driver in rust" type of thing, but the firmware bindings do help out the phy rust drivers, and the driver core bindings give a solid base on which others can start their work. There is still a long way to go here before we have a multitude of rust drivers being added, but it's a great first step. - driver core const api changes. This reached across all bus types, and there are some fix-ups for some not-common bus types that linux-next and 0-day testing shook out. This work is being done to help make the rust bindings more safe, as well as the C code, moving toward the end-goal of allowing us to put driver structures into read-only memory. We aren't there yet, but are getting closer. - minor devres cleanups and fixes found by code inspection - arch_topology minor changes - other minor driver core cleanups All of these have been in linux-next for a very long time with no reported problems" * tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (55 commits) ARM: sa1100: make match function take a const pointer sysfs/cpu: Make crash_hotplug attribute world-readable dio: Have dio_bus_match() callback take a const * zorro: make match function take a const pointer driver core: module: make module_[add|remove]_driver take a const * driver core: make driver_find_device() take a const * driver core: make driver_[create|remove]_file take a const * firmware_loader: fix soundness issue in `request_internal` firmware_loader: annotate doctests as `no_run` devres: Correct code style for functions that return a pointer type devres: Initialize an uninitialized struct member devres: Fix memory leakage caused by driver API devm_free_percpu() devres: Fix devm_krealloc() wasting memory driver core: platform: Switch to use kmemdup_array() driver core: have match() callback in struct bus_type take a const * MAINTAINERS: add Rust device abstractions to DRIVER CORE device: rust: improve safety comments MAINTAINERS: add Danilo as FIRMWARE LOADER maintainer MAINTAINERS: add Rust FW abstractions to FIRMWARE LOADER firmware: rust: improve safety comments ...
2 parents b2eed73 + b57d5ff commit c2a96b7

File tree

216 files changed

+778
-624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+778
-624
lines changed

MAINTAINERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6850,6 +6850,7 @@ F: include/linux/fwnode.h
68506850
F: include/linux/kobj*
68516851
F: include/linux/property.h
68526852
F: lib/kobj*
6853+
F: rust/kernel/device.rs
68536854

68546855
DRIVERS FOR OMAP ADAPTIVE VOLTAGE SCALING (AVS)
68556856
M: Nishanth Menon <[email protected]>
@@ -8716,10 +8717,12 @@ F: include/linux/arm_ffa.h
87168717
FIRMWARE LOADER (request_firmware)
87178718
M: Luis Chamberlain <[email protected]>
87188719
M: Russ Weight <[email protected]>
8720+
M: Danilo Krummrich <[email protected]>
87198721
87208722
S: Maintained
87218723
F: Documentation/firmware_class/
87228724
F: drivers/base/firmware_loader/
8725+
F: rust/kernel/firmware.rs
87238726
F: include/linux/firmware.h
87248727

87258728
FLEXTIMER FTM-QUADDEC DRIVER

arch/arm/common/locomo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,10 +816,10 @@ EXPORT_SYMBOL(locomo_frontlight_set);
816816
* We model this as a regular bus type, and hang devices directly
817817
* off this.
818818
*/
819-
static int locomo_match(struct device *_dev, struct device_driver *_drv)
819+
static int locomo_match(struct device *_dev, const struct device_driver *_drv)
820820
{
821821
struct locomo_dev *dev = LOCOMO_DEV(_dev);
822-
struct locomo_driver *drv = LOCOMO_DRV(_drv);
822+
const struct locomo_driver *drv = LOCOMO_DRV(_drv);
823823

824824
return dev->devid == drv->devid;
825825
}

arch/arm/common/sa1111.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,10 +1339,10 @@ EXPORT_SYMBOL_GPL(sa1111_get_irq);
13391339
* We model this as a regular bus type, and hang devices directly
13401340
* off this.
13411341
*/
1342-
static int sa1111_match(struct device *_dev, struct device_driver *_drv)
1342+
static int sa1111_match(struct device *_dev, const struct device_driver *_drv)
13431343
{
13441344
struct sa1111_dev *dev = to_sa1111_device(_dev);
1345-
struct sa1111_driver *drv = SA1111_DRV(_drv);
1345+
const struct sa1111_driver *drv = SA1111_DRV(_drv);
13461346

13471347
return !!(dev->devid & drv->devid);
13481348
}

arch/arm/include/asm/hardware/locomo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct locomo_driver {
189189
void (*remove)(struct locomo_dev *);
190190
};
191191

192-
#define LOCOMO_DRV(_d) container_of((_d), struct locomo_driver, drv)
192+
#define LOCOMO_DRV(_d) container_of_const((_d), struct locomo_driver, drv)
193193

194194
#define LOCOMO_DRIVER_NAME(_ldev) ((_ldev)->dev.driver->name)
195195

arch/arm/include/asm/hardware/sa1111.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ struct sa1111_driver {
404404
void (*remove)(struct sa1111_dev *);
405405
};
406406

407-
#define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv)
407+
#define SA1111_DRV(_d) container_of_const((_d), struct sa1111_driver, drv)
408408

409409
#define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name)
410410

arch/parisc/include/asm/parisc-device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct parisc_driver {
4141

4242

4343
#define to_parisc_device(d) container_of(d, struct parisc_device, dev)
44-
#define to_parisc_driver(d) container_of(d, struct parisc_driver, drv)
44+
#define to_parisc_driver(d) container_of_const(d, struct parisc_driver, drv)
4545
#define parisc_parent(d) to_parisc_device(d->dev.parent)
4646

4747
static inline const char *parisc_pathname(struct parisc_device *d)

arch/parisc/kernel/drivers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int for_each_padev(int (*fn)(struct device *, void *), void * data)
9797
* @driver: the PA-RISC driver to try
9898
* @dev: the PA-RISC device to try
9999
*/
100-
static int match_device(struct parisc_driver *driver, struct parisc_device *dev)
100+
static int match_device(const struct parisc_driver *driver, struct parisc_device *dev)
101101
{
102102
const struct parisc_device_id *ids;
103103

@@ -548,7 +548,7 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path)
548548
return dev;
549549
}
550550

551-
static int parisc_generic_match(struct device *dev, struct device_driver *drv)
551+
static int parisc_generic_match(struct device *dev, const struct device_driver *drv)
552552
{
553553
return match_device(to_parisc_driver(drv), to_parisc_device(dev));
554554
}

arch/powerpc/include/asm/ps3.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,7 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev);
390390
int ps3_system_bus_driver_register(struct ps3_system_bus_driver *drv);
391391
void ps3_system_bus_driver_unregister(struct ps3_system_bus_driver *drv);
392392

393-
static inline struct ps3_system_bus_driver *ps3_drv_to_system_bus_drv(
394-
struct device_driver *_drv)
395-
{
396-
return container_of(_drv, struct ps3_system_bus_driver, core);
397-
}
393+
#define ps3_drv_to_system_bus_drv(_drv) container_of_const(_drv, struct ps3_system_bus_driver, core)
398394
static inline struct ps3_system_bus_device *ps3_dev_to_system_bus_dev(
399395
const struct device *_dev)
400396
{

arch/powerpc/include/asm/vio.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,7 @@ static inline int vio_enable_interrupts(struct vio_dev *dev)
156156
}
157157
#endif
158158

159-
static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
160-
{
161-
return container_of(drv, struct vio_driver, driver);
162-
}
163-
159+
#define to_vio_driver(__drv) container_of_const(__drv, struct vio_driver, driver)
164160
#define to_vio_dev(__dev) container_of_const(__dev, struct vio_dev, dev)
165161

166162
#endif /* __KERNEL__ */

arch/powerpc/platforms/ps3/system-bus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ int ps3_mmio_region_init(struct ps3_system_bus_device *dev,
333333
EXPORT_SYMBOL_GPL(ps3_mmio_region_init);
334334

335335
static int ps3_system_bus_match(struct device *_dev,
336-
struct device_driver *_drv)
336+
const struct device_driver *_drv)
337337
{
338338
int result;
339-
struct ps3_system_bus_driver *drv = ps3_drv_to_system_bus_drv(_drv);
339+
const struct ps3_system_bus_driver *drv = ps3_drv_to_system_bus_drv(_drv);
340340
struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
341341

342342
if (!dev->match_sub_id)

0 commit comments

Comments
 (0)